+ Update aqua user list #45
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: "+ Update aqua user list" | |
on: | |
workflow_dispatch: {} | |
schedule: | |
- cron: "0 0 * * *" # daily | |
jobs: | |
update-list: | |
runs-on: ubuntu-latest | |
permissions: {} | |
steps: | |
- uses: actions/checkout@f43a0e5ff2bd294095638e18286ca9a3d1956744 # v3.6.0 | |
- uses: actions/setup-go@93397bea11091df50f3d7e59dc26a7711a8bcfbe # v4.1.0 | |
with: | |
go-version: 1.21.0 | |
- id: generate_token | |
uses: tibdex/github-app-token@b62528385c34dbc9f38e5f4225ac829252d1ea92 # v1.8.0 | |
with: | |
app_id: ${{secrets.APP_ID_AQUAPROJ_AQUA}} | |
private_key: ${{secrets.APP_PRIVATE_KEY_AQUAPROJ_AQUA}} | |
- uses: aquaproj/aqua-installer@36dc5833b04eb63f06e3bb818aa6b7a6e6db99a9 # v2.1.2 | |
# Install ghcp | |
with: | |
aqua_version: v2.10.1 | |
env: | |
AQUA_GITHUB_TOKEN: ${{github.token}} | |
- run: ghcp -v | |
env: | |
GITHUB_TOKEN: ${{github.token}} | |
- run: go run ./cmd/list-aqua-users | tee docs/LIST.md | |
env: | |
GITHUB_TOKEN: ${{github.token}} | |
- run: cat docs/HEADER.md docs/LIST.md docs/FOOTER.md > README.md | |
- id: create-branch | |
run: | | |
branch=update-list-$(date +%Y%m%d%H%M%S) | |
echo "branch=$branch" >> "$GITHUB_OUTPUT" | |
ghcp commit -r "$GITHUB_REPOSITORY" -m "docs: update the user list" -b "$branch" README.md docs/LIST.md | |
env: | |
GITHUB_TOKEN: ${{steps.generate_token.outputs.token}} | |
- run: | | |
body="This pull request is created by [GitHub Actions]($GITHUB_SERVER_URL/$GITHUB_REPOSITORY/actions/runs/$GITHUB_RUN_ID)." | |
gh pr create -t "docs: update the user list" -H "$BRANCH" -b "$body" | |
env: | |
BRANCH: ${{steps.create-branch.outputs.branch}} | |
GITHUB_TOKEN: ${{steps.generate_token.outputs.token}} |