Skip to content

Commit 5d642d3

Browse files
committed
fix permissions
Signed-off-by: Frederic BIDON <fredbi@yahoo.com>
1 parent 7d7fe49 commit 5d642d3

2 files changed

Lines changed: 15 additions & 13 deletions

File tree

.github/workflows/doc-update.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ on:
3030
workflow_call:
3131

3232
permissions:
33-
pull-requests: read
33+
pull-requests: write
3434
contents: read
3535

3636
env:
@@ -466,14 +466,14 @@ jobs:
466466
echo "target_repo=${{ github.repository }}" >> "$GITHUB_OUTPUT"
467467
echo "pr_number=${{ github.event.pull_request.number }}" >> "$GITHUB_OUTPUT"
468468
echo "pr_sha=${{ github.event.pull_request.head.sha }}" >> "$GITHUB_OUTPUT"
469-
echo "artifact_name=${{ env.spelling_artifact }}" >> "$GITHUB_OUTPUT"
470-
echo "comment_title=${{ env.spelling_comment_title }}" >> "$GITHUB_OUTPUT"
469+
echo "artifact_name=${{ env.spellcheck_artifact }}" >> "$GITHUB_OUTPUT"
470+
echo "comment_title=${{ env.spellcheck_comment_title }}" >> "$GITHUB_OUTPUT"
471471
echo "reactions=confused" >> "$GITHUB_OUTPUT"
472472
473473
pr-comment-spelling-report:
474474
name: Create or update comment
475475
needs: pr-markdown-spelling-report
476-
secrets: inherit
476+
secrets: inherits
477477
uses: ./.github/workflows/pr-comment.yml
478478
with:
479479
run_id: ${{ needs.pr-markdown-spelling-report.outputs.run_id }}

.github/workflows/pr-comment.yml

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ jobs:
113113
if: ${{ steps.check_pr.outputs.proceed == 'true'}}
114114
run: |
115115
MESSAGE_FILE="${{ steps.download.outputs.download-path }}/${{ inputs.artifact_name }}"
116-
SIZE=$(wc -c "${MESSAGE_FILE}")
116+
SIZE=$(cat "${MESSAGE_FILE}"|wc -c)
117117
if [[ "${SIZE}" -gt "${{ env.MAX_MESSAGE_SIZE }}" ]] ; then
118118
# truncate the message up to MAX_MESSAGE_SIZE
119119
head -c ${{ env.MAX_MESSAGE_SIZE }} "${MESSAGE_FILE}" > /tmp/truncated
@@ -134,13 +134,15 @@ jobs:
134134
direction: last
135135
token: ${{ secrets.GITHUB_TOKEN }}
136136

137-
- name: Acquire write access to PR
138-
if: ${{ steps.check_pr.outputs.proceed == 'true'}}
139-
id: acquire_write_token
140-
uses: actions/create-github-app-token@v2
141-
with:
142-
app-id: ${{ secrets.CI_WORKFLOWS_PR_APP_ID }}
143-
private-key: ${{ secrets.CI_WORKFLOWS_PR_APP_PRIVATE_KEY }}
137+
#- name: Acquire write access to PR
138+
# if: ${{ steps.check_pr.outputs.proceed == 'true'}}
139+
# id: acquire_write_token
140+
# uses: actions/create-github-app-token@v2
141+
# with:
142+
# app-id: ${{ secrets.CI_WORKFLOWS_PR_APP_ID }}
143+
# private-key: ${{ secrets.CI_WORKFLOWS_PR_APP_PRIVATE_KEY }}
144+
# owner: go-openapi
145+
# repo: ${{ inputs.target_repo }}
144146

145147
- name: Create or update PR comment
146148
if: ${{ steps.check_pr.outputs.proceed == 'true'}}
@@ -152,7 +154,7 @@ jobs:
152154
reactions-edit-mode: replace
153155
body-path: ${{ steps.download.outputs.download-path }}/${{ inputs.artifact_name }}
154156
edit-mode: replace
155-
token: ${{ steps.acquire_write_token.outputs.token }}
157+
token: ${{ secrets.GITHUB_TOKEN }}
156158

157159
- name: Notify
158160
run: |

0 commit comments

Comments
 (0)