Skip to content

Commit

Permalink
Merge pull request #24 from budougumi0617/use-app
Browse files Browse the repository at this point in the history
ci: generate token by GitHub App
  • Loading branch information
budougumi0617 authored Sep 18, 2024
2 parents eae6208 + 16ef6a2 commit db1a15f
Showing 1 changed file with 17 additions and 7 deletions.
24 changes: 17 additions & 7 deletions .github/workflows/tag-and-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,28 +9,38 @@ jobs:
runs-on: ubuntu-latest
outputs:
tagpr-tag: ${{ steps.run-tagpr.outputs.tag }}
env:
GITHUB_TOKEN: ${{ secrets.GH_PAT }}
steps:
- uses: actions/create-github-app-token@v1
id: app-token
with:
app-id: ${{ secrets.APP_ID }}
private-key: ${{ secrets.PRIVATE_KEY }}
- name: Check out source code
uses: actions/checkout@v4
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version-file: go.mod
cache: true
token: ${{ steps.app-token.outputs.token }}
- id: run-tagpr
name: Run tagpr
uses: Songmu/tagpr@v1
env:
GITHUB_TOKEN: ${{ steps.app-token.outputs.token }}
goreleaser:
needs: tagpr
if: needs.tagpr.outputs.tagpr-tag != ''
runs-on: ubuntu-latest
steps:
- uses: actions/create-github-app-token@v1
id: app-token
with:
app-id: ${{ secrets.APP_ID }}
private-key: ${{ secrets.PRIVATE_KEY }}
owner: "budougumi0617"
repositories: "homebrew-tap"
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
token: ${{ steps.app-token.outputs.token }}
- name: Set up Go
uses: actions/setup-go@v5
with:
Expand All @@ -46,4 +56,4 @@ jobs:
args: release --clean
env:
# need to access other repository for brew-tap
GITHUB_TOKEN: ${{ secrets.GH_PAT }}
GITHUB_TOKEN: ${{ steps.app-token.outputs.token }}

0 comments on commit db1a15f

Please sign in to comment.