Skip to content

Commit

Permalink
[prtester] add 'github.event.number' fallback to 'none'
Browse files Browse the repository at this point in the history
  • Loading branch information
User123698745 committed Oct 22, 2024
1 parent cb36bc2 commit efc3ba4
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions .github/workflows/prhtmlgenerator.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
- name: Check number of bridges
id: check_bridges
run: |
PR=${{github.event.number}};
PR=${{ github.event.number || 'none' }};
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);
echo "BRIDGES=$bridgeamount" >> "$GITHUB_OUTPUT"
Expand All @@ -39,7 +39,7 @@ jobs:
repository: ${{github.event.pull_request.head.repo.full_name}}
- name: Check out rss-bridge
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 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;
Expand All @@ -65,7 +65,7 @@ jobs:
id: testrun
run: |
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="${body//'%'/'%25'}";
body="${body//$'\n'/'%0A'}";
Expand Down Expand Up @@ -114,14 +114,14 @@ jobs:
name: tests
- name: Move tests
run: |
DIRECTORY="$GITHUB_WORKSPACE/prs/${{ github.event.number }}"
DIRECTORY="$GITHUB_WORKSPACE/prs/${{ github.event.number || 'none' }}"
rm -rf $DIRECTORY
mkdir -p $DIRECTORY
cd $DIRECTORY
mv -f $GITHUB_WORKSPACE/*.html .
- name: Commit and push generated tests
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 commit -m "$COMMIT_MESSAGE" || exit 0
git push

0 comments on commit efc3ba4

Please sign in to comment.