Skip to content

Commit

Permalink
Run workflows on release branches
Browse files Browse the repository at this point in the history
- Allow workflows to run on `release/*` branches where appropriate.
- Remove redundant `if` condition escaping.
  • Loading branch information
martincostello committed Jan 4, 2024
1 parent 008b952 commit 546316b
Show file tree
Hide file tree
Showing 7 changed files with 18 additions and 18 deletions.
10 changes: 5 additions & 5 deletions .github/workflows/actions-lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@ name: actions-lint

on:
push:
branches: [ main ]
branches: [ main, release/* ]
paths-ignore:
- '**/*.gitattributes'
- '**/*.gitignore'
- '**/*.md'
- '**/*.gitattributes'
- '**/*.gitignore'
- '**/*.md'
pull_request:
branches: [ main ]
branches: [ main, release/* ]
workflow_dispatch:

permissions:
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@ name: build

on:
push:
branches: [ main ]
branches: [ main, release/* ]
tags: [ '*' ]
pull_request:
branches: [ main ]
branches: [ main, release/* ]
workflow_dispatch:

env:
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ name: code-scan

on:
push:
branches: [ main ]
branches: [ main, release/* ]
pull_request:
branches: [ main ]
branches: [ main, release/* ]
schedule:
- cron: '0 8 * * MON'
workflow_dispatch:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/dependabot-approve.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ permissions:
jobs:
review:
runs-on: ubuntu-latest
if: ${{ github.event.repository.fork == false && github.event.pull_request.user.login == 'dependabot[bot]' }}
if: github.event.repository.fork == false && github.event.pull_request.user.login == 'dependabot[bot]'

steps:

Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/dependency-review.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,15 @@ name: dependency-review

on:
pull_request:
branches: [ main ]
branches: [ main, release/* ]

permissions:
contents: read

jobs:
dependency-review:
runs-on: ubuntu-latest
if: ${{ github.event.repository.fork == false }}
if: github.event.repository.fork == false

steps:

Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/gh-pages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ name: github-pages

on:
push:
branches: [ main ]
branches: [ main, release/* ]
pull_request:
branches: [ main ]
branches: [ main, release/* ]
workflow_dispatch:

permissions:
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/updater-approve.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,15 @@ name: updater-approve

on:
pull_request:
branches: [ main ]
branches: [ main, release/* ]

permissions:
contents: read

jobs:
review:
runs-on: ubuntu-latest
if: ${{ github.event.repository.fork == false && github.event.pull_request.user.login == 'polly-updater-bot[bot]' }}
if: github.event.repository.fork == false && github.event.pull_request.user.login == 'polly-updater-bot[bot]'

env:
REVIEWER_LOGIN: "polly-reviewer-bot[bot]"
Expand Down Expand Up @@ -98,7 +98,7 @@ jobs:
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1

- name: Approve pull request and enable auto-merge
if: ${{ steps.check-dependencies.outputs.is-trusted-update == 'true' }}
if: steps.check-dependencies.outputs.is-trusted-update == 'true'
env:
GH_TOKEN: ${{ steps.generate-application-token.outputs.token }}
PR_URL: ${{ github.event.pull_request.html_url }}
Expand All @@ -118,7 +118,7 @@ jobs:
}
- name: Disable auto-merge and dismiss approvals
if: ${{ steps.check-dependencies.outputs.is-trusted-update != 'true' }}
if: steps.check-dependencies.outputs.is-trusted-update != 'true'
env:
GH_TOKEN: ${{ steps.generate-application-token.outputs.token }}
PR_URL: ${{ github.event.pull_request.html_url }}
Expand Down

0 comments on commit 546316b

Please sign in to comment.