mirror of
https://github.com/axios/axios.git
synced 2026-04-11 02:11:50 +08:00
* ci: set hardened --ignore-scripts for all ci actions * docs: adds new docs platform * chore: remove un-needed ignore * chore: add sponsors data. adjust package.json to be of type module * fix: inconsistency between the docs and readme * fix: docs inconsistency * docs: update language and phrasing * style: fix issues with card styling * docs: update security.md with latest changes * docs: remove un-needed code * docs: fix inconsistencies with actual library function * ci: added deployment for docs * chore: added axios as dep for docs * docs: fix batch of errors * fix: bump esbuild as the version included is a risk
75 lines
2.5 KiB
YAML
75 lines
2.5 KiB
YAML
name: Update readme sponsor block
|
|
|
|
on:
|
|
workflow_dispatch:
|
|
repository_dispatch:
|
|
types:
|
|
- webhook
|
|
schedule:
|
|
- cron: '0 1 * * *'
|
|
|
|
permissions:
|
|
contents: write
|
|
pull-requests: write
|
|
|
|
jobs:
|
|
sponsors:
|
|
if: github.repository == 'axios/axios'
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
|
|
with:
|
|
fetch-depth: 0
|
|
persist-credentials: false
|
|
- 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@53b83947a5a98c8d113130e565377fae1a50d02f # v6.3.0
|
|
with:
|
|
node-version: 24.x
|
|
cache: npm
|
|
- name: Install dependencies
|
|
run: npm ci --ignore-scripts
|
|
- name: Check if sponsors require updates
|
|
id: sponsors-requires-update
|
|
run: node ./scripts/update-readme-sponsors.mjs
|
|
- name: Check tracked README sponsor diff
|
|
id: readme-tracked-change
|
|
run: |
|
|
if git diff --quiet -- README.md; then
|
|
echo "readme_changed=false" >> "$GITHUB_OUTPUT"
|
|
else
|
|
echo "readme_changed=true" >> "$GITHUB_OUTPUT"
|
|
fi
|
|
- name: Read sponsors.md file content
|
|
run: |
|
|
echo 'CONTENT<<EOF' >> $GITHUB_ENV
|
|
cat ./temp/sponsors.md >> $GITHUB_ENV
|
|
echo 'EOF' >> $GITHUB_ENV
|
|
shell: bash
|
|
if: steps.sponsors-requires-update.outputs.changed == 'true' && steps.readme-tracked-change.outputs.readme_changed == 'true'
|
|
- name: Echo sponsors content
|
|
run: |
|
|
echo "$CONTENT"
|
|
if: steps.sponsors-requires-update.outputs.changed == 'true' && steps.readme-tracked-change.outputs.readme_changed == 'true'
|
|
- name: Create pull request
|
|
uses: peter-evans/create-pull-request@c0f553fe549906ede9cf27b5156039d195d2ece0 # v8.1.0
|
|
with:
|
|
branch: sponsors
|
|
delete-branch: true
|
|
commit-message: 'chore(sponsor): update sponsor block'
|
|
title: 'chore(docs): update sponsor block'
|
|
body: |
|
|
**New sponsor block update:**
|
|
${{ env.CONTENT }}
|
|
labels: |
|
|
commit::docs
|
|
priority::high
|
|
type::automated-pr
|
|
signoff: false
|
|
draft: false
|
|
if: steps.sponsors-requires-update.outputs.changed == 'true' && steps.readme-tracked-change.outputs.readme_changed == 'true'
|