Skip to content
Permalink
Browse files

Reduce noise from workflows (#34372)

Only trigger workflows to doc and backport when appropriate
  • Loading branch information
m-kuhn committed Feb 10, 2020
1 parent 77f47f0 commit ef108f3538e96d1edbba987c4b4a04f762a05b31
@@ -11,7 +11,7 @@ jobs:
name: Backport
steps:
- name: Backport Bot
if: contains( join(github.event.pull_request.labels.*.name), 'backport')
if: github.event.pull_request.merged && ( ( github.event.action == 'closed' && contains( github.event.pull_request.labels.*.name, 'backport') ) || contains( github.event.label.name, 'backport' ) )
uses: Gaurav0/backport@v1.0.24
with:
bot_username: qgis-bot
@@ -7,7 +7,7 @@ on:
- labeled
jobs:
test:
if: contains( github.event.pull_request.labels.*.name, 'Needs Documentation')
if: github.event.label.name == 'Needs Documentation'
runs-on: ubuntu-latest
steps:
# obfuscate the github token so it can be used on jobs triggered from forks
@@ -15,7 +15,7 @@ jobs:

# 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')
if: github.event.pull_request.merged && ( ( github.event.action == 'closed' && contains( github.event.pull_request.labels.*.name, 'Needs Documentation') ) || github.event.label.name == 'Needs Documentation' )
id: token
uses: opengisch/clear-token@v1.0.12
with:
@@ -24,7 +24,7 @@ jobs:

# transform the milestone (e.g. 3.10.4) to a doc label (3.10)
- name: QGIS milestone to Doc label
if: github.event.pull_request.merged && contains( github.event.pull_request.labels.*.name, 'Needs Documentation')
if: github.event.pull_request.merged && ( ( github.event.action == 'closed' && contains( github.event.pull_request.labels.*.name, 'Needs Documentation') ) || github.event.label.name == 'Needs Documentation' )
id: milestone2label
env:
MILESTONE: ${{ github.event.pull_request.milestone.title }}
@@ -36,7 +36,7 @@ jobs:
# get the PR body
- name: Get PR body as JSON
if: github.event.pull_request.merged && contains( github.event.pull_request.labels.*.name, 'Needs Documentation')
if: github.event.pull_request.merged && ( ( github.event.action == 'closed' && contains( github.event.pull_request.labels.*.name, 'Needs Documentation') ) || github.event.label.name == 'Needs Documentation' )
id: get_pr_info
uses: octokit/request-action@v2.x
env:
@@ -47,7 +47,7 @@ jobs:

# extract body from json output
- name: Get PR body as text
if: github.event.pull_request.merged && contains( github.event.pull_request.labels.*.name, 'Needs Documentation')
if: github.event.pull_request.merged && ( ( github.event.action == 'closed' && contains( github.event.pull_request.labels.*.name, 'Needs Documentation') ) || github.event.label.name == 'Needs Documentation' )
id: get_pr_body
uses: gr2m/get-json-paths-action@v1.x
with:
@@ -56,7 +56,7 @@ jobs:

# get commits from the PR
- name: Get PR commits
if: github.event.pull_request.merged && contains( github.event.pull_request.labels.*.name, 'Needs Documentation')
if: github.event.pull_request.merged && ( ( github.event.action == 'closed' && contains( github.event.pull_request.labels.*.name, 'Needs Documentation') ) || github.event.label.name == 'Needs Documentation' )
uses: octokit/request-action@v2.x
id: get_pr_commits
env:
@@ -67,7 +67,7 @@ jobs:

# extracts the matching commits
- name: Filter commits with \[needs?.doc(umentation)?s?\]
if: github.event.pull_request.merged && contains( github.event.pull_request.labels.*.name, 'Needs Documentation')
if: github.event.pull_request.merged && ( ( github.event.action == 'closed' && contains( github.event.pull_request.labels.*.name, 'Needs Documentation') ) || github.event.label.name == 'Needs Documentation' )
id: filtered_commits
env:
JSON_DATA: ${{ steps.get_pr_commits.outputs.data }}
@@ -77,7 +77,7 @@ jobs:
# create the documentation issue
- name: Create Documentation issue
if: github.event.pull_request.merged && contains( github.event.pull_request.labels.*.name, 'Needs Documentation')
if: github.event.pull_request.merged && ( ( github.event.action == 'closed' && contains( github.event.pull_request.labels.*.name, 'Needs Documentation') ) || github.event.label.name == 'Needs Documentation' )
id: doc_issue
uses: maxkomarychev/oction-create-issue@v0.7.1
with:
@@ -104,7 +104,7 @@ jobs:
# write comment to ping the PR author
- name: Create comment
if: github.event.pull_request.merged && contains( github.event.pull_request.labels.*.name, 'Needs Documentation')
if: github.event.pull_request.merged && ( ( github.event.action == 'closed' && contains( github.event.pull_request.labels.*.name, 'Needs Documentation') ) || github.event.label.name == 'Needs Documentation' )
uses: peter-evans/create-or-update-comment@v1
with:
token: ${{ steps.token.outputs.token }}

0 comments on commit ef108f3

Please sign in to comment.
You can’t perform that action at this time.