Skip to content

Commit

Permalink
Use GitHub App to push version bumps (#1443)
Browse files Browse the repository at this point in the history
* Add github app secret token

* skip actions trigged by version bump commit

* trigger main-workflow on any PR
+ remove trigger on "develop" branch
  • Loading branch information
Felixmil authored Jul 15, 2024
1 parent c8d202b commit 1678597
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 3 deletions.
12 changes: 11 additions & 1 deletion .github/workflows/bump-dev-version.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,17 @@ jobs:
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
permissions: write-all
steps:

- uses: actions/create-github-app-token@v1
id: app-token
with:
app-id: ${{ vars.VERSION_BUMPER_APPID }}
private-key: ${{ secrets.VERSION_BUMPER_SECRET }}

- uses: actions/checkout@v4
with:
fetch-depth: 0
token: ${{ steps.app-token.outputs.token }}

- name: Setup R
uses: r-lib/actions/setup-r@v2
Expand All @@ -33,6 +43,6 @@ jobs:
uses: EndBug/add-and-commit@v9
if: ${{ success() }}
with:
message: '🤖 Bump development version.'
message: '🤖 Bump development version. [skip actions]'
default_author: github_actions
add: 'DESCRIPTION'
7 changes: 5 additions & 2 deletions .github/workflows/main-workflow.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,16 @@ name: Main-Workflow

on:
push:
branches: [main, develop]
branches: [main]
pull_request:
branches: [main, develop]


jobs:
bump-dev-version: # only do that when actually merging in main/develop branch
if: github.event_name != 'pull_request'
uses: ./.github/workflows/bump-dev-version.yaml
secrets: inherit

R-CMD-Check:
if: ${{ always() }}
needs: [bump-dev-version]
Expand All @@ -21,6 +22,7 @@ jobs:
extra-packages: |
ospsuite.utils=github::Open-Systems-Pharmacology/OSPSuite.RUtils
tlf=github::Open-Systems-Pharmacology/TLF-Library
test-coverage:
if: ${{ always() }}
needs: [R-CMD-Check]
Expand All @@ -31,6 +33,7 @@ jobs:
extra-packages: |
ospsuite.utils=github::Open-Systems-Pharmacology/OSPSuite.RUtils
tlf=github::Open-Systems-Pharmacology/TLF-Library
pkgdown:
if: ${{ always() }}
needs: [R-CMD-Check]
Expand Down

0 comments on commit 1678597

Please sign in to comment.