Skip to content

Commit

Permalink
Update workflow actions and try workaround for doc update PR (#898)
Browse files Browse the repository at this point in the history
  • Loading branch information
itavero committed Jul 3, 2024
1 parent d9b75f6 commit e860b98
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 11 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/analyze.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:
if: github.event.workflow_run.event == 'pull_request' && github.event.workflow_run.conclusion == 'success'
steps:
- name: Get PR info
uses: actions/github-script@v6
uses: actions/github-script@v7
with:
script: |
var artifacts = await github.rest.actions.listWorkflowRunArtifacts({
Expand All @@ -43,13 +43,13 @@ jobs:
for info in pr/* ; do echo ::set-output name=$(basename $info)::$(cat $info); done
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
fetch-depth: 0
ref: refs/pull/${{ steps.pr.outputs.number }}/merge

- name: Get reports
uses: actions/github-script@v6
uses: actions/github-script@v7
with:
script: |
var artifacts = await github.rest.actions.listWorkflowRunArtifacts({
Expand All @@ -73,7 +73,7 @@ jobs:
run: unzip reports.zip

- name: SonarCloud
uses: SonarSource/sonarcloud-github-action@master
uses: SonarSource/sonarcloud-github-action@v2
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
Expand Down
15 changes: 12 additions & 3 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,10 @@ jobs:
versions_file: src/docgen/versions.ts
steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Use Node.js 20.x
uses: actions/setup-node@v3
uses: actions/setup-node@v4
with:
node-version: 20.x

Expand Down Expand Up @@ -54,11 +54,20 @@ jobs:
echo "updated=0" >> $GITHUB_OUTPUT
node_modules/.bin/ts-node src/docgen/docgen.ts
git diff --exit-code -s docs ||echo "updated=1" >> $GITHUB_OUTPUT
- uses: tibdex/github-app-token@v2
if: ${{ steps.docs.outputs.updated == 1 }}
id: pr-token
with:
app_id: ${{ secrets.PR_APP_ID }}
private_key: ${{ secrets.PR_APP_SECRET }}

- name: Open/update PR
if: ${{ steps.docs.outputs.updated == 1 }}
uses: peter-evans/create-pull-request@v4
id: cpr
uses: peter-evans/create-pull-request@v6
with:
token: ${{ steps.pr-token.outputs.token }}
assignees: itavero
commit-message: "Docs generated based on zigbee-herdsman-converters v${{ steps.version.outputs.herdsman }}"
branch: update-device-docs
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/verify.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,10 @@ jobs:

steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}

Expand All @@ -61,7 +61,7 @@ jobs:
- name: Archive reports and info (for PR)
if: github.event_name == 'pull_request' && matrix.node-version == env.node-version-analysis
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: reports
retention-days: 7
Expand All @@ -72,7 +72,7 @@ jobs:
reports/tests.xml
- name: SonarCloud (on push)
uses: sonarsource/sonarcloud-github-action@master
uses: sonarsource/sonarcloud-github-action@v2
if: github.event_name == 'push' && matrix.node-version == env.node-version-analysis
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
Expand Down

0 comments on commit e860b98

Please sign in to comment.