Skip to content

Commit

Permalink
Update cmd.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
mordamax committed Jul 23, 2024
1 parent 6412637 commit 73a0663
Showing 1 changed file with 34 additions and 25 deletions.
59 changes: 34 additions & 25 deletions .github/workflows/cmd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,38 @@ jobs:
content: 'eyes'
})
- name: Generate a token
id: commands_token
uses: actions/[email protected]
with:
app-id: ${{ secrets.COMMAND_APP_ID }}
private-key: ${{ secrets.COMMAND_APP_KEY }}


- name: Clean previous comments
if: ${{ contains(github.event.comment.body, '--clean') }}
uses: actions/github-script@v7
with:
github-token: ${{ steps.commands_token.outputs.token }}
script: |
github.rest.issues.listComments({
issue_number: context.issue.number,
owner: context.repo.owner,
repo: context.repo.repo
}).then(comments => {
for (let comment of comments.data) {
console.log(comment)
console.log(comment.author)
if (comment.body.startsWith('Command') && comment.author.login === 'github-actions[bot]') {
github.rest.issues.deleteComment({
comment_id: comment.id,
owner: context.repo.owner,
repo: context.repo.repo
})
}
}
})
cmd:
if: ${{ startsWith(github.event.comment.body, '/cmd') && !contains(github.event.comment.body, '--help') }}
runs-on: ${{ startsWith(github.event.comment.body, '/cmd bench') && 'arc-runners-beefy-stg' || 'ubuntu-22.04' }}
Expand Down Expand Up @@ -95,29 +127,6 @@ jobs:
echo "job_url=$jobLink" >> $GITHUB_OUTPUT
echo "run_url=$runLink" >> $GITHUB_OUTPUT
- name: Clean previous comments
if: ${{ contains(github.event.comment.body, '--clean') }}
uses: actions/github-script@v7
with:
github-token: ${{ steps.commands_token.outputs.token }}
script: |
github.rest.issues.listComments({
issue_number: context.issue.number,
owner: context.repo.owner,
repo: context.repo.repo
}).then(comments => {
for (let comment of comments.data) {
console.log(comment)
console.log(comment.author)
if (comment.body.startsWith('Command') && comment.author.login === 'github-actions[bot]') {
github.rest.issues.deleteComment({
comment_id: comment.id,
owner: context.repo.owner,
repo: context.repo.repo
})
}
}
})
- name: Comment PR (Start)
if: ${{ !contains(github.event.comment.body, '--quiet') }}
Expand All @@ -143,9 +152,9 @@ jobs:
run: cat .github/env >> $GITHUB_ENV

- name: Install Rust
uses: dtolnay/rust-toolchain@stable
uses: dtolnay/rust-toolchain@master
with:
targets: "wasm32-unknown-unknown"
targets: "wasm32-unknown-unknown,x86_64-unknown-linux-musl"
components: "rust-src rustfmt clippy"
toolchain: "nightly-${{env.RUST_NIGHTLY_VERSION}}"

Expand Down

0 comments on commit 73a0663

Please sign in to comment.