+ Update aqua user list #399
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: | |
timeout-minutes: 30 | |
runs-on: ubuntu-latest | |
permissions: {} | |
steps: | |
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7 | |
- uses: actions/setup-go@0a12ed9d6a96ab950c8f026ed9f722fe0da7ef32 # v5.0.2 | |
with: | |
go-version: 1.22.6 | |
- id: generate_token | |
uses: tibdex/github-app-token@3beb63f4bd073e61482598c45c71c1019b59b73a # v2.1.0 | |
with: | |
app_id: ${{secrets.APP_ID_AQUAPROJ_AQUA}} | |
private_key: ${{secrets.APP_PRIVATE_KEY_AQUAPROJ_AQUA}} | |
repositories: >- | |
[ | |
"${{github.event.repository.name}}" | |
] | |
permissions: >- | |
{ | |
"pull_requests": "write", | |
"contents": "write" | |
} | |
- uses: aquaproj/aqua-installer@6ce1f8848ec8e61f14d57bd5d7597057a6dd187c # v3.0.1 | |
# Install ghcp | |
with: | |
aqua_version: v2.30.0 | |
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}} |