From b40392faa19ed9fd816603764f8942c7929e19f0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Agust=C3=ADn=20Borgna?= <121866228+aborgna-q@users.noreply.github.com> Date: Fri, 24 May 2024 16:16:48 +0100 Subject: [PATCH] ci: Use hugrbot token in CI (#1110) Replaces my own account's tokens with @hugrbot's. Closes #1082 drive-by: Drop the unused jira-issue workflow. --- .github/workflows/issue.yml | 69 ---------------------------- .github/workflows/pr-title.yml | 3 ++ .github/workflows/release-please.yml | 2 +- .github/workflows/release-plz.yml | 2 +- 4 files changed, 5 insertions(+), 71 deletions(-) delete mode 100644 .github/workflows/issue.yml diff --git a/.github/workflows/issue.yml b/.github/workflows/issue.yml deleted file mode 100644 index 6bf93e9a2..000000000 --- a/.github/workflows/issue.yml +++ /dev/null @@ -1,69 +0,0 @@ -name: New issue - -on: - issues: - types: [opened] - -jobs: - jira_task: - name: Create Jira issue - runs-on: ubuntu-22.04 - steps: - - name: Login - uses: atlassian/gajira-login@v3.0.1 - env: - JIRA_BASE_URL: ${{ secrets.JIRA_BASE_URL }} - JIRA_USER_EMAIL: ${{ secrets.JIRA_USER_EMAIL }} - JIRA_API_TOKEN: ${{ secrets.JIRA_API_TOKEN }} - - name: Parse the priority label into a Jira priority - id: set_priority_var - env: - LABELS: ${{ join(github.event.issue.labels.*.name, ' ') }} - run: | - MY_RESULT="" - for label in $LABELS - do - case $label in - P-low) - MY_RESULT=Low - break;; - P-medium) - MY_RESULT=Medium - break;; - P-high) - MY_RESULT=High - break;; - P-critical) - MY_RESULT=Highest - break;; - esac - done - if [ ! -z $MY_RESULT ] - then - MY_RESULT=", \"priority\": { \"name\": \"$MY_RESULT\" }" - fi - echo "JIRA_PRIORITY_FIELD=$MY_RESULT" >> $GITHUB_OUTPUT - - - name: Create Bug - uses: atlassian/gajira-create@v3.0.1 - if: ${{ contains(github.event.issue.labels.*.name, 'bug') }} - env: - JIRA_PRIORITY_FIELD: ${{ steps.set_priority_var.outputs.JIRA_PRIORITY_FIELD }} - with: - project: TKET - issuetype: Bug - summary: « [hugr] ${{ github.event.issue.title }}» - description: ${{ github.event.issue.html_url }} - fields: '{ "labels": ["hugr"] ${{ env.JIRA_PRIORITY_FIELD }} }' - - - name: Create Task - uses: atlassian/gajira-create@v3.0.1 - if: ${{ ! contains(github.event.issue.labels.*.name, 'bug') }} - env: - JIRA_PRIORITY_FIELD: ${{ steps.set_priority_var.outputs.JIRA_PRIORITY_FIELD }} - with: - project: TKET - issuetype: Task - summary: « [hugr] ${{ github.event.issue.title }}» - description: ${{ github.event.issue.html_url }} - fields: '{ "labels": ["hugr"] ${{ env.JIRA_PRIORITY_FIELD }} }' diff --git a/.github/workflows/pr-title.yml b/.github/workflows/pr-title.yml index 3cd9a8b4a..d33312f95 100644 --- a/.github/workflows/pr-title.yml +++ b/.github/workflows/pr-title.yml @@ -118,6 +118,7 @@ jobs: It looks like your proposed title indicates a breaking change. If that's the case, please make sure to include a "BREAKING CHANGE:" footer in the body of the pull request describing the breaking change and any migration instructions. + GITHUB_TOKEN: ${{ secrets.HUGRBOT_PAT }} - name: Fail if the footer is required but missing if: ${{ steps.breaking.outputs.breaking == 'true' && steps.breaking.outputs.has_breaking_footer == 'false' }} run: exit 1 @@ -150,6 +151,7 @@ jobs: ``` ${{ steps.lint_pr_title.outputs.error_message }} ``` + GITHUB_TOKEN: ${{ secrets.HUGRBOT_PAT }} # Delete previous comments when the issues have been resolved # This step doesn't run if any of the previous checks fails. @@ -158,3 +160,4 @@ jobs: with: header: pr-title-lint-error delete: true + GITHUB_TOKEN: ${{ secrets.HUGRBOT_PAT }} diff --git a/.github/workflows/release-please.yml b/.github/workflows/release-please.yml index e3e855fa1..04bc04c10 100644 --- a/.github/workflows/release-please.yml +++ b/.github/workflows/release-please.yml @@ -19,5 +19,5 @@ jobs: - uses: google-github-actions/release-please-action@v4 with: # Using a personal access token so releases created by this workflow can trigger the deployment workflow - token: ${{ secrets.RELEASE_PLEASE_PAT }} + token: ${{ secrets.HUGRBOT_PAT }} config-file: release-please-config.json diff --git a/.github/workflows/release-plz.yml b/.github/workflows/release-plz.yml index 8b724ff7e..0552da80f 100644 --- a/.github/workflows/release-plz.yml +++ b/.github/workflows/release-plz.yml @@ -24,5 +24,5 @@ jobs: - name: Run release-plz uses: MarcoIeni/release-plz-action@v0.5 env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + GITHUB_TOKEN: ${{ secrets.HUGRBOT_PAT }} CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }}