mirror of
https://github.com/RSS-Bridge/rss-bridge.git
synced 2025-04-12 18:08:47 +00:00
[prtester] add 'github.event.number' fallback to 'none'
This commit is contained in:
parent
cb36bc2375
commit
efc3ba4e8e
10
.github/workflows/prhtmlgenerator.yml
vendored
10
.github/workflows/prhtmlgenerator.yml
vendored
@ -15,7 +15,7 @@ jobs:
|
|||||||
- name: Check number of bridges
|
- name: Check number of bridges
|
||||||
id: check_bridges
|
id: check_bridges
|
||||||
run: |
|
run: |
|
||||||
PR=${{github.event.number}};
|
PR=${{ github.event.number || 'none' }};
|
||||||
wget https://patch-diff.githubusercontent.com/raw/$GITHUB_REPOSITORY/pull/$PR.patch;
|
wget https://patch-diff.githubusercontent.com/raw/$GITHUB_REPOSITORY/pull/$PR.patch;
|
||||||
bridgeamount=$(cat $PR.patch | grep "\bbridges/[A-Za-z0-9]*Bridge\.php\b" | sed "s=.*\bbridges/\([A-Za-z0-9]*\)Bridge\.php\b.*=\1=g" | sort | uniq | wc -l);
|
bridgeamount=$(cat $PR.patch | grep "\bbridges/[A-Za-z0-9]*Bridge\.php\b" | sed "s=.*\bbridges/\([A-Za-z0-9]*\)Bridge\.php\b.*=\1=g" | sort | uniq | wc -l);
|
||||||
echo "BRIDGES=$bridgeamount" >> "$GITHUB_OUTPUT"
|
echo "BRIDGES=$bridgeamount" >> "$GITHUB_OUTPUT"
|
||||||
@ -39,7 +39,7 @@ jobs:
|
|||||||
repository: ${{github.event.pull_request.head.repo.full_name}}
|
repository: ${{github.event.pull_request.head.repo.full_name}}
|
||||||
- name: Check out rss-bridge
|
- name: Check out rss-bridge
|
||||||
run: |
|
run: |
|
||||||
PR=${{github.event.number}};
|
PR=${{ github.event.number || 'none' }};
|
||||||
wget -O requirements.txt https://raw.githubusercontent.com/$GITHUB_REPOSITORY/${{ github.event.pull_request.base.ref }}/.github/prtester-requirements.txt;
|
wget -O requirements.txt https://raw.githubusercontent.com/$GITHUB_REPOSITORY/${{ github.event.pull_request.base.ref }}/.github/prtester-requirements.txt;
|
||||||
wget https://raw.githubusercontent.com/$GITHUB_REPOSITORY/${{ github.event.pull_request.base.ref }}/.github/prtester.py;
|
wget https://raw.githubusercontent.com/$GITHUB_REPOSITORY/${{ github.event.pull_request.base.ref }}/.github/prtester.py;
|
||||||
wget https://patch-diff.githubusercontent.com/raw/$GITHUB_REPOSITORY/pull/$PR.patch;
|
wget https://patch-diff.githubusercontent.com/raw/$GITHUB_REPOSITORY/pull/$PR.patch;
|
||||||
@ -65,7 +65,7 @@ jobs:
|
|||||||
id: testrun
|
id: testrun
|
||||||
run: |
|
run: |
|
||||||
mkdir results;
|
mkdir results;
|
||||||
python prtester.py --artifacts-base-url "https://${{ github.repository_owner }}.github.io/${{ vars.ARTIFACTS_REPO || 'rss-bridge-tests' }}/prs/${{ github.event.number }}";
|
python prtester.py --artifacts-base-url "https://${{ github.repository_owner }}.github.io/${{ vars.ARTIFACTS_REPO || 'rss-bridge-tests' }}/prs/${{ github.event.number || 'none' }}";
|
||||||
body="$(cat comment.txt)";
|
body="$(cat comment.txt)";
|
||||||
body="${body//'%'/'%25'}";
|
body="${body//'%'/'%25'}";
|
||||||
body="${body//$'\n'/'%0A'}";
|
body="${body//$'\n'/'%0A'}";
|
||||||
@ -114,14 +114,14 @@ jobs:
|
|||||||
name: tests
|
name: tests
|
||||||
- name: Move tests
|
- name: Move tests
|
||||||
run: |
|
run: |
|
||||||
DIRECTORY="$GITHUB_WORKSPACE/prs/${{ github.event.number }}"
|
DIRECTORY="$GITHUB_WORKSPACE/prs/${{ github.event.number || 'none' }}"
|
||||||
rm -rf $DIRECTORY
|
rm -rf $DIRECTORY
|
||||||
mkdir -p $DIRECTORY
|
mkdir -p $DIRECTORY
|
||||||
cd $DIRECTORY
|
cd $DIRECTORY
|
||||||
mv -f $GITHUB_WORKSPACE/*.html .
|
mv -f $GITHUB_WORKSPACE/*.html .
|
||||||
- name: Commit and push generated tests
|
- name: Commit and push generated tests
|
||||||
run: |
|
run: |
|
||||||
export COMMIT_MESSAGE="Added tests for PR ${{github.event.number}}"
|
export COMMIT_MESSAGE="Added tests for PR ${{ github.event.number || 'none' }}"
|
||||||
git add .
|
git add .
|
||||||
git commit -m "$COMMIT_MESSAGE" || exit 0
|
git commit -m "$COMMIT_MESSAGE" || exit 0
|
||||||
git push
|
git push
|
||||||
|
Loading…
Reference in New Issue
Block a user