-
Notifications
You must be signed in to change notification settings - Fork 59
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Labeling fixes, Use Concurrency to cancel workflows (#1487)
### What kind of change does this PR introduce? * Fixes a bug that was recognizing all PRs as though they were coming from forks of Ouranosinc/xclim * Removes credentials from the actions-version-updater.yml so that I don't get the commit credit (and cannot approve the resulting PR) * Replace the styfle/cancel-workflow-action with concurrency
- Loading branch information
Showing
6 changed files
with
15 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -14,6 +14,7 @@ jobs: | |
- uses: actions/[email protected] | ||
with: | ||
token: ${{ secrets.WORKFLOW_TOKEN }} | ||
persist-credentials: false | ||
- name: Run GitHub Actions Version Updater | ||
uses: saadmk11/[email protected] | ||
with: | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -37,7 +37,7 @@ jobs: | |
comment_approved: | ||
name: Comment Concerning Approved Tag | ||
if: | | ||
(github.event_name == 'pull_request_target') || | ||
(github.event_name == 'pull_request_target') && | ||
(github.event.pull_request.head.repo.full_name != github.event.pull_request.base.repo.full_name) | ||
runs-on: ubuntu-latest | ||
steps: | ||
|
@@ -50,8 +50,9 @@ jobs: | |
body-includes: This Pull Request is coming from a fork and must be manually tagged `approved` in order to perform additional testing | ||
- name: Create comment | ||
if: | | ||
(steps.fc.outputs.comment-id == '') || | ||
(!contains(github.event.pull_request.labels.*.name, 'approved')) | ||
(steps.fc.outputs.comment-id == '') && | ||
(!contains(github.event.pull_request.labels.*.name, 'approved')) && | ||
(github.event.pull_request.head.repo.full_name != github.event.pull_request.base.repo.full_name) | ||
uses: peter-evans/[email protected] | ||
with: | ||
comment-id: ${{ steps.fc.outputs.comment-id }} | ||
|
@@ -68,7 +69,8 @@ jobs: | |
comment-id: ${{ steps.fc.outputs.comment-id }} | ||
issue-number: ${{ github.event.pull_request.number }} | ||
body: | | ||
Pull Request is approved! | ||
> **Note** | ||
> This Pull Request is approved! | ||
reactions: | | ||
hooray | ||
edit-mode: append |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -22,6 +22,11 @@ on: | |
env: | ||
XCLIM_TESTDATA_BRANCH: v2023.9.12 | ||
|
||
concurrency: | ||
# For a given workflow, if we push to the same branch, cancel all previous builds on that branch except on master. | ||
group: ${{ github.workflow }}-${{ github.ref }} | ||
cancel-in-progress: ${{ github.ref != 'refs/heads/master' }} | ||
|
||
jobs: | ||
lint: | ||
name: Black (Python${{ matrix.python-version }}) | ||
|
@@ -35,10 +40,6 @@ jobs: | |
python-version: | ||
- "3.8" | ||
steps: | ||
- name: Cancel previous runs | ||
uses: styfle/[email protected] | ||
with: | ||
access_token: ${{ github.token }} | ||
- uses: actions/[email protected] | ||
- name: Set up Python${{ matrix.python-version }} | ||
uses: actions/[email protected] | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -16,7 +16,7 @@ on: | |
type: boolean | ||
|
||
jobs: | ||
build: | ||
toot: | ||
runs-on: ubuntu-latest | ||
environment: production | ||
steps: | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters