mirror of
https://github.com/tenrok/axios.git
synced 2026-06-11 18:02:32 +03:00
69 lines
2.1 KiB
YAML
69 lines
2.1 KiB
YAML
name: Update Readme sponsor list
|
|
on:
|
|
workflow_dispatch:
|
|
repository_dispatch:
|
|
types:
|
|
- webhook
|
|
schedule:
|
|
# Run at 0000 daily
|
|
- cron: '0 1 * * *'
|
|
jobs:
|
|
sponsors:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v3
|
|
with:
|
|
fetch-depth: 0
|
|
- name: git config
|
|
run: |
|
|
git config user.name "${GITHUB_ACTOR}"
|
|
git config user.email "${GITHUB_ACTOR}@users.noreply.github.com"
|
|
- name: Setup node
|
|
uses: actions/setup-node@v3
|
|
with:
|
|
node-version: 16
|
|
cache: npm
|
|
- run: npm ci
|
|
- name: Check sponsors updates
|
|
id: sponsors
|
|
run: node ./bin/sponsors.js
|
|
- name: Notify status
|
|
if: ${{ steps.sponsors.outputs.changed }}
|
|
run: |
|
|
echo "Sponsor block has changed. Creating PR with updates..."
|
|
- name: Read sponsors.md file content
|
|
id: read_file
|
|
run: |
|
|
FILE_CONTENT=$(cat ./temp/sponsors.md)
|
|
echo "File content: $FILE_CONTENT"
|
|
echo "::set-output name=file_content::$FILE_CONTENT"
|
|
shell: bash
|
|
- name: Create pull request
|
|
if: ${{ steps.sponsors.outputs.changed }}
|
|
uses: peter-evans/create-pull-request@v6
|
|
id: cpr
|
|
with:
|
|
branch: sponsors
|
|
delete-branch: true
|
|
commit-message: 'chore(sponsor): update sponsor block'
|
|
title: '[Chore] Update sponsor block'
|
|
body: |
|
|
**New sponsor block update:**
|
|
{{ steps.read_file.outputs.file_content }}
|
|
labels: |
|
|
readme
|
|
automated pr
|
|
automerge
|
|
signoff: false
|
|
#team-reviewers: |
|
|
# owners
|
|
# maintainers
|
|
#assignees: jasonsaayman
|
|
#reviewers: jasonsaayman
|
|
draft: false
|
|
- name: Show PR link
|
|
if: ${{ steps.sponsors.outputs.changed }}
|
|
run: |
|
|
echo "Sponsor block has changed. Creating PR..."
|
|
echo "Axios Release v${{ steps.package-version.outputs.current-version}}' pull request - ${{ steps.cpr.outputs.pull-request-url }}"
|