chore(main): release 1.3.0 #12
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Command Dispatch | |
on: | |
issue_comment: | |
types: [created] | |
permissions: read-all | |
jobs: | |
slash-command: | |
if: github.event.issue.pull_request && github.event.issue.user.login == 'FabrizioCafolla' | |
runs-on: ubuntu-22.04 | |
steps: | |
- name: Get PR repo and ref | |
id: getref | |
uses: actions/github-script@v7 | |
with: | |
github-token: ${{ secrets.ACTION_WORKFLOWS }} | |
script: | | |
const pr_number = "${{ github.event.issue.pull_request.url }}".split("/").slice(-1); | |
const pr = await github.rest.pulls.get({ | |
owner: "italia-opensource", | |
repo: "italiaopensource.com", | |
pull_number: pr_number, | |
}); | |
core.exportVariable('PR_NUMBER', pr.data.number); | |
core.exportVariable('PR_URL', pr.data.html_url); | |
core.exportVariable('USER', pr.data.user.login); | |
core.exportVariable('PR_REF', pr.data.head.ref); | |
core.exportVariable('PR_SHA', pr.data.head.sha); | |
- name: Slash Command Dispatch | |
id: scd | |
uses: peter-evans/slash-command-dispatch@v4 | |
with: | |
token: ${{ secrets.ACTION_WORKFLOWS }} | |
permission: write | |
commands: | | |
deploy-website | |
deploy-infrastructure | |
static-args: | | |
pr_number=${{ env.PR_NUMBER }} | |
pr_url=${{ env.PR_URL }} | |
pr_ref=${{ env.PR_REF }} | |
pr_sha=${{ env.PR_SHA }} | |
user=${{ env.USER }} | |
comment_id=${{ github.event.comment.id }} | |
dispatch-type: repository | |
reactions: false | |
- name: Add error message to comment | |
if: steps.scd.outputs.error-message | |
uses: peter-evans/create-or-update-comment@v4 | |
with: | |
token: ${{ secrets.ACTION_WORKFLOWS }} | |
comment-id: ${{ github.event.comment.id }} | |
body: | | |
> Error: ${{ steps.scd.outputs.error-message }} |