mirror of
https://github.com/tenrok/axios.git
synced 2026-05-15 11:59:42 +03:00
chore(action): fix sponsors action; (#6557)
This commit is contained in:
@@ -28,18 +28,21 @@ jobs:
|
||||
id: sponsors
|
||||
run: node ./bin/sponsors.js
|
||||
- name: Notify status
|
||||
if: ${{ steps.sponsors.outputs.changed }}
|
||||
if: ${{ steps.sponsors.outputs.changed == 'true'}}
|
||||
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"
|
||||
echo 'CONTENT<<EOF' >> $GITHUB_ENV
|
||||
cat ./temp/sponsors.md >> $GITHUB_ENV
|
||||
echo 'EOF' >> $GITHUB_ENV
|
||||
shell: bash
|
||||
- name: Echo
|
||||
run: |
|
||||
echo "$CONTENT"
|
||||
- name: Create pull request
|
||||
if: ${{ steps.sponsors.outputs.changed }}
|
||||
if: ${{ steps.sponsors.outputs.changed == 'true'}}
|
||||
uses: peter-evans/create-pull-request@v6
|
||||
id: cpr
|
||||
with:
|
||||
@@ -49,7 +52,7 @@ jobs:
|
||||
title: '[Chore] Update sponsor block'
|
||||
body: |
|
||||
**New sponsor block update:**
|
||||
{{ steps.read_file.outputs.file_content }}
|
||||
${{ env.CONTENT }}
|
||||
labels: |
|
||||
readme
|
||||
automated pr
|
||||
@@ -62,7 +65,7 @@ jobs:
|
||||
#reviewers: jasonsaayman
|
||||
draft: false
|
||||
- name: Show PR link
|
||||
if: ${{ steps.sponsors.outputs.changed }}
|
||||
if: ${{ steps.sponsors.outputs.changed == 'true'}}
|
||||
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 }}"
|
||||
|
||||
+1
-1
@@ -56,7 +56,7 @@ const updateReadmeSponsors = async (url, path, marker = '<!--<div>marker</div>--
|
||||
(async(url) => {
|
||||
const newContent = await updateReadmeSponsors(url, './README.md');
|
||||
|
||||
await exec(`echo "tag=${newContent ? 'true' : 'false'}" >> $GITHUB_OUTPUT`);
|
||||
await exec(`echo "changed=${newContent ? 'true' : 'false'}" >> $GITHUB_OUTPUT`);
|
||||
if (newContent !== false) {
|
||||
await fs.mkdir('./temp').catch(() => {});
|
||||
await fs.writeFile('./temp/sponsors.md', newContent);
|
||||
|
||||
Reference in New Issue
Block a user