Skip to content

Commit

Permalink
add upload to bridgestatus
Browse files Browse the repository at this point in the history
  • Loading branch information
User123698745 authored and actions-user committed Nov 26, 2024
1 parent abd8a55 commit 76d3d59
Showing 1 changed file with 63 additions and 2 deletions.
65 changes: 63 additions & 2 deletions .github/workflows/bridgestatus.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,17 @@ on:
- cron: 0 0 * * 4

jobs:
init:
name: Initialization
runs-on: ubuntu-latest
outputs:
WITH_UPLOAD: ${{ steps.check_upload.outputs.WITH_UPLOAD }}
steps:
- name: "Check upload token secret RSSTESTER_ACTION is set"
id: check_upload
run: |
echo "WITH_UPLOAD=$([ -n "${{ secrets.RSSTESTER_ACTION }}" ] && echo "true" || echo "false")" >> "$GITHUB_OUTPUT"
update-comment:
name: Update comment
runs-on: ubuntu-latest
Expand Down Expand Up @@ -33,10 +44,17 @@ jobs:
pip install --requirement requirements.txt
- name: Run prtester.py
run: |-
python .github/prtester.py --title "${{ vars.OVERVIEW_ISSUE_COMMENT_TITLE }}" --output-file "comment.md" --reduced-upload --instances "http://localhost:3000"
python .github/prtester.py \
--title "${{ vars.OVERVIEW_ISSUE_COMMENT_TITLE }}" \
--instances "http://localhost:3000" \
--reduced-artifacts \
--artifacts-base-url "https://${{ github.repository_owner }}.github.io/${{ vars.ARTIFACTS_REPO || 'rss-bridge-tests' }}/status" \
--output-file "comment.md"
sed -E 's/(${{ vars.OVERVIEW_ISSUE_COMMENT_TITLE }})/\1 (failed only)/g' comment.md | sed '/✔️/d' > comment_failed.md
- name: Upload artifacts
uses: actions/upload-artifact@v4
with:
name: artifacts
path: |
comment.md
*.html
Expand All @@ -53,5 +71,48 @@ jobs:
with:
issue-number: ${{ vars.OVERVIEW_ISSUE_ID }}
comment-id: ${{ steps.find_comment.outputs.comment-id }}
body-file: comment.md
body-file: comment_failed.md
edit-mode: replace

upload-artifacts:
name: Upload artifacts
runs-on: ubuntu-latest
needs:
- init
- update-comment
if: needs.init.outputs.WITH_UPLOAD == 'true'
steps:
- name: Checkout
uses: actions/checkout@v4
with:
repository: "${{ github.repository_owner }}/${{ vars.ARTIFACTS_REPO || 'rss-bridge-tests' }}"
ref: 'main'
token: ${{ secrets.RSSTESTER_ACTION }}
- name: Setup git config
run: |
git config --global user.name "GitHub Actions"
git config --global user.email "<>"
- name: Download artifacts
uses: actions/download-artifact@v4
with:
name: artifacts
- name: Move artifacts
run: |
mv ./comment.md ./README.md
DIRECTORY="$GITHUB_WORKSPACE/status"
rm -rf $DIRECTORY
mkdir -p $DIRECTORY
cd $DIRECTORY
cp $GITHUB_WORKSPACE/README.md ./README.md
mv $GITHUB_WORKSPACE/*.html .
- name: Commit and push artifacts
run: |
export COMMIT_MESSAGE="Updated status artifacts"
git add .
git commit -m "$COMMIT_MESSAGE" || exit 0
git push
- name: Delete artifacts
uses: geekyeggo/delete-artifact@v5
with:
name: artifacts
failOnError: false

0 comments on commit 76d3d59

Please sign in to comment.