-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Modernize sponsors automation workflow (#3098)
- Loading branch information
Showing
1 changed file
with
18 additions
and
33 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,57 +1,42 @@ | ||
name: Generate Sponsors README | ||
on: workflow_dispatch | ||
|
||
jobs: | ||
deploy: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
|
||
- name: Get token | ||
id: get-token | ||
uses: actions/create-github-app-token@v1 | ||
with: | ||
app-id: ${{ vars.PENNY_APP_ID }} | ||
private-key: ${{ secrets.PENNY_APP_PRIVATE_KEY }} | ||
owner: vapor | ||
repositories: ${{ matrix.repository }} | ||
|
||
- name: Generate Sponsors | ||
uses: JamesIves/github-sponsors-readme-action@v1 | ||
with: | ||
token: ${{ secrets.SPONSORS_PAT }} | ||
token: ${{ steps.get-token.outputs.token }} | ||
file: "README.md" | ||
minimum: 500 | ||
maximum: 9900 | ||
marker: "backers" | ||
organization: true | ||
|
||
# Here we can eventually add sponsors too rather than just backers | ||
|
||
- name: Get token | ||
id: get-token | ||
uses: tibdex/github-app-token@v2 | ||
with: | ||
app_id: ${{ vars.PENNY_APP_ID }} | ||
private_key: ${{ secrets.PENNY_APP_PRIVATE_KEY }} | ||
repository: vapor/vapor | ||
|
||
- name: Commit and create PR | ||
uses: peter-evans/create-pull-request@v5 | ||
with: | ||
commit-message: Update README with new sponsor | ||
with: | ||
token: ${{ steps.get-token.outputs.token }} | ||
commit-message: "[skip ci] Update README with new sponsor" | ||
committer: "Penny[bot] <360798+penny[bot]@vapor.codes>" | ||
author: "Penny[bot] <360798+penny[bot]@vapor.codes>" | ||
branch: new-sponsor | ||
branch: update-sponsors | ||
delete-branch: true | ||
title: Update README with new Sponsor | ||
title: Update README with new sponsor | ||
body: Update README adding new sponsor | ||
labels: no-release-needed | ||
|
||
# We can comment this out if we want to automate approve and merge | ||
|
||
# - name: Enable Pull Request Automerge | ||
# if: steps.cpr.outputs.pull-request-operation == 'created' | ||
# uses: peter-evans/enable-pull-request-automerge@v2 | ||
# with: | ||
# token: ${{ secrets.SPONSORS_PR_PAT }} | ||
# pull-request-number: ${{ steps.cpr.outputs.pull-request-number }} | ||
# merge-method: merge | ||
|
||
# - name: Auto approve | ||
# if: steps.cpr.outputs.pull-request-operation == 'created' | ||
# uses: juliangruber/approve-pull-request-action@v2 | ||
# with: | ||
# github-token: ${{ secrets.SPONSORS_PR_PAT }} | ||
# number: ${{ steps.cpr.outputs.pull-request-number }} | ||
labels: no-release-needed,sponsors | ||
reviewers: 0xTim |