Skip to content

Commit

Permalink
fix: try comments have incorrect permissions
Browse files Browse the repository at this point in the history
  • Loading branch information
sprutton1 committed Dec 9, 2024
1 parent e5d5049 commit 141a6cf
Showing 1 changed file with 9 additions and 24 deletions.
33 changes: 9 additions & 24 deletions .github/workflows/try.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,17 +14,12 @@ jobs:
if: ${{ github.event.issue.pull_request && startsWith(github.event.comment.body, '/try') }}
runs-on: ubuntu-latest
steps:
- uses: actions/github-script@v7
- uses: peter-evans/create-or-update-comment@v4
id: create-comment
with:
script: |
const { data } = await github.rest.issues.createComment({
issue_number: context.issue.number,
owner: context.repo.owner,
repo: context.repo.repo,
body: 'Okay, starting a try! I\'ll update this comment when it starts...'
});
return { id: data.id };
issue-number: ${{ github.event.pull_request.number }}
body: |
'Okay, starting a try! I\'ll comment again once the build starts...'
- uses: xt0rted/pull-request-comment-branch@v2
id: comment-branch
Expand All @@ -39,19 +34,9 @@ jobs:
ignore_pipeline_branch_filter: true
send_pull_request: true

- uses: actions/github-script@v7
- uses: peter-evans/create-or-update-comment@v4
id: create-comment
with:
script: |
const commentId = "${{ steps.create-comment.outputs.id }}";
const buildUrl = "${{ steps.run-build.outputs.url }}";
if (!commentId || !buildUrl) {
throw new Error("Missing comment ID or build URL.");
}
await github.rest.issues.updateComment({
owner: context.repo.owner,
repo: context.repo.repo,
comment_id: commentId,
body: `πŸš€ [Try running here](${buildUrl})! πŸš€`
});
issue-number: ${{ github.event.pull_request.number }}
body: |
`πŸš€ [Try running here](${{ steps.run-build.outputs.url }}! πŸš€`

0 comments on commit 141a6cf

Please sign in to comment.