Skip to content

Commit

Permalink
Update RelativeCI agent action (openhab#2063)
Browse files Browse the repository at this point in the history
The RelativeCI action was using the CLI with an inline API key.

This PR replaces the RelativeCI CLI with the action agent running on workflow_run
event and in the context of the default branch (secrets are not leaked to forks). 

Signed-off-by: Viorel Cojocaru <[email protected]>
  • Loading branch information
vio authored Sep 26, 2023
1 parent 0449622 commit eee0277
Show file tree
Hide file tree
Showing 5 changed files with 23 additions and 1,205 deletions.
16 changes: 6 additions & 10 deletions .github/workflows/mainui.yml
Original file line number Diff line number Diff line change
Expand Up @@ -74,13 +74,9 @@ jobs:
with:
name: report
path: /home/runner/work/openhab-webui/openhab-webui/bundles/org.openhab.ui/web/report.html

- name: Upload stats to RelativeCI
run: npx relative-ci-agent
env:
# was: RELATIVE_CI_KEY: ${{ secrets.RELATIVE_CI_KEY }}
# but wouldn't work for PRs made from forks...
# Bad practice (!), however since the service itself as well as
# what can be done with the key (add new bundle stats) is not
# critical, not hiding the key is deemed acceptable for now!
RELATIVE_CI_KEY: f8e0e450-804c-11eb-b7f5-510e2634a5c9

# Upload bundle stats to use on relative-ci.yaml workflow
- name: Upload webpack stats artifact
uses: relative-ci/[email protected]
with:
webpackStatsFile: ./bundles/org.openhab.ui/web/stats.json
17 changes: 17 additions & 0 deletions .github/workflows/relative-ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
name: RelativeCI

on:
workflow_run:
workflows: ["Main UI"]
types:
- completed

jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Send bundle stats and build information to RelativeCI
uses: relative-ci/[email protected]
with:
key: ${{ secrets.RELATIVE_CI_KEY }}
token: ${{ secrets.GITHUB_TOKEN }}
Loading

0 comments on commit eee0277

Please sign in to comment.