Skip to content

Commit

Permalink
[github] move condition at step level
Browse files Browse the repository at this point in the history
instead of job level

this should stop the spammy notification about failing jobS2
  • Loading branch information
3nids committed Jan 14, 2020
1 parent 84563cb commit 7602174
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/backport.yml
Expand Up @@ -7,11 +7,11 @@ on:

jobs:
backport:
if: contains( join(github.event.pull_request.labels.*.name), 'backport')
runs-on: ubuntu-18.04
name: Backport
steps:
- name: Backport Bot
if: contains( join(github.event.pull_request.labels.*.name), 'backport')
uses: Gaurav0/backport@v1.0.24
with:
bot_username: qgis-bot
Expand Down
9 changes: 8 additions & 1 deletion .github/workflows/pr_to_doc_issue.yml
Expand Up @@ -9,13 +9,13 @@ on:

jobs:
pr2docissue:
if: github.event.pull_request.merged && contains( github.event.pull_request.labels.*.name, 'Needs Documentation')
runs-on: ubuntu-latest
name: Create issue on doc repo for labeled issue
steps:

# obfuscate the github token so it can be used on jobs triggered from forks
- name: Clear GH Token
if: github.event.pull_request.merged && contains( github.event.pull_request.labels.*.name, 'Needs Documentation')
id: token
uses: opengisch/clear-token@v1.0.12
with:
Expand All @@ -24,6 +24,7 @@ jobs:

# transform the milestone (e.g. 3.10.4) to a doc label (3.10)
- name: QGIS milestone to Doc label
if: cancelled() == false
id: milestone2label
env:
MILESTONE: ${{ github.event.pull_request.milestone.title }}
Expand All @@ -35,6 +36,7 @@ jobs:
# get the PR body
- name: Get PR body as JSON
if: cancelled() == false
id: get_pr_info
uses: octokit/request-action@v2.x
env:
Expand All @@ -45,6 +47,7 @@ jobs:

# extract body from json output
- name: Get PR body as text
if: cancelled() == false
id: get_pr_body
uses: gr2m/get-json-paths-action@v1.x
with:
Expand All @@ -53,6 +56,7 @@ jobs:

# get commits from the PR
- name: Get PR commits
if: cancelled() == false
uses: octokit/request-action@v2.x
id: get_pr_commits
env:
Expand All @@ -63,6 +67,7 @@ jobs:

# extracts the matching commits
- name: Filter commits with \[needs?.doc(umentation)?s?\]
if: cancelled() == false
id: filtered_commits
env:
JSON_DATA: ${{ steps.get_pr_commits.outputs.data }}
Expand All @@ -72,6 +77,7 @@ jobs:
# create the documentation issue
- name: Create Documentation issue
if: cancelled() == false
id: doc_issue
uses: maxkomarychev/oction-create-issue@v0.7.1
with:
Expand All @@ -98,6 +104,7 @@ jobs:
# write comment to ping the PR author
- name: Create comment
if: cancelled() == false
uses: peter-evans/create-or-update-comment@v1
with:
token: ${{ steps.token.outputs.token }}
Expand Down

0 comments on commit 7602174

Please sign in to comment.