Skip to content

Commit

Permalink
CIにGitHub AppのTokenを与える (#54)
Browse files Browse the repository at this point in the history
  • Loading branch information
massongit authored Feb 9, 2024
1 parent 110a316 commit ed26dbf
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 3 deletions.
10 changes: 8 additions & 2 deletions .github/workflows/format-json-yml.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,21 @@ jobs:
format-json-yml:
runs-on: ubuntu-latest
steps:
- name: Generate a token
id: generate_token
uses: actions/[email protected]
with:
app-id: ${{ secrets.PROJECT_AUTOMATION_APP_ID }}
private-key: ${{ secrets.PROJECT_AUTOMATION_PRIVATE_KEY }}
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
if: github.event_name != 'pull_request' || github.event.action != 'closed'
with:
fetch-depth: 0
ref: ${{ github.event.pull_request.head.sha || github.event.merge_group.head_sha }}
token: ${{secrets.CREATE_WORKFLOW_CI_TOKEN}}
token: ${{ steps.generate_token.outputs.token }}
- uses: dev-hato/actions-format-json-yml@6bd738c4b2889bb69be70a0da7d947c91d457534 # v0.0.59
with:
github-token: ${{secrets.GITHUB_TOKEN}}
github-token: ${{ steps.generate_token.outputs.token }}
concurrency:
group: ${{ github.workflow }}-${{ github.event_name }}-${{ github.ref }}
cancel-in-progress: true
8 changes: 7 additions & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,12 @@ jobs:
# tagがなければ、一つ前のtagからパッチバージョンを1足して新しくtagをつける
- if: steps.get_current_tag.outputs.current_tag == ''
run: git tag "$(git describe --tags --abbrev=0 | awk -F. '{$NF = $NF + 1;} 1' | sed 's/ /./g')"
- name: Generate a token
id: generate_token
uses: actions/[email protected]
with:
app-id: ${{ secrets.PROJECT_AUTOMATION_APP_ID }}
private-key: ${{ secrets.PROJECT_AUTOMATION_PRIVATE_KEY }}
# More assembly might be required: Docker logins, GPG, etc.
# It all depends on your needs.
- name: Run GoReleaser
Expand All @@ -36,6 +42,6 @@ jobs:
args: release --clean
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
HOMEBREW_TAP_GITHUB_TOKEN: ${{ secrets.HOMEBREW_TAP_GITHUB_TOKEN }}
HOMEBREW_TAP_GITHUB_TOKEN: ${{ steps.generate_token.outputs.token }}
# Your GoReleaser Pro key, if you are using the 'goreleaser-pro' distribution
# GORELEASER_KEY: ${{ secrets.GORELEASER_KEY }}

0 comments on commit ed26dbf

Please sign in to comment.