Skip to content

Commit

Permalink
Add GitHub tokens for creating PR and approving it
Browse files Browse the repository at this point in the history
  • Loading branch information
felladrin authored and roboquat committed Nov 9, 2022
1 parent 184fec8 commit 6d6d1f9
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 9 deletions.
22 changes: 13 additions & 9 deletions .github/workflows/jetbrains-update-plugin-platform-template.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,12 @@ on:
secrets:
slackWebhook:
required: true
roboquatRepoPat:
required: true
jobs:
update-plugin-platform:
name: Update Platform Version from ${{ inputs.pluginName }}
runs-on: ubuntu-latest
permissions:
pull-requests: write
env:
SNAPSHOTS_HTML_FILENAME: snapshots.html
steps:
Expand Down Expand Up @@ -72,7 +72,7 @@ jobs:
if: ${{ inputs.pluginId == 'gateway-plugin' && steps.latest-version.outputs.result != steps.current-version.outputs.result }}
uses: peter-evans/create-pull-request@v4
with:
title: "Update Platform Version from ${{ inputs.pluginName }}"
title: "[JetBrains] Update Platform Version from ${{ inputs.pluginName }}"
body: |
## Description
This PR updates the Platform Version from ${{ inputs.pluginName }} to the latest version.
Expand All @@ -96,14 +96,16 @@ jobs:
commit-message: "Update Platform Version of ${{ inputs.pluginName }} to ${{ steps.latest-version.outputs.result }}"
branch: "jetbrains/${{ inputs.pluginId }}-platform"
labels: "team: IDE,editor: jetbrains"
# We can't use `team-reviewers` until we resolve https://github.com/gitpod-io/gitpod/issues/12194
# team-reviewers: "engineering-ide"
team-reviewers: "engineering-ide"
token: ${{ secrets.roboquatRepoPat }}
committer: Robo Quat <[email protected]>
author: Robo Quat <[email protected]>
- name: Create Pull Request for Backend Plugin
id: create-pr
if: ${{ inputs.pluginId == 'backend-plugin' && steps.latest-version.outputs.result != steps.current-version.outputs.result }}
uses: peter-evans/create-pull-request@v4
with:
title: "Update Platform Version from ${{ inputs.pluginName }}"
title: "[JetBrains] Update Platform Version from ${{ inputs.pluginName }}"
body: |
## Description
This PR updates the Platform Version from ${{ inputs.pluginName }} to the latest version.
Expand All @@ -129,13 +131,15 @@ jobs:
commit-message: "Update Platform Version of ${{ inputs.pluginName }} to ${{ steps.latest-version.outputs.result }}"
branch: "jetbrains/${{ inputs.pluginId }}-platform"
labels: "team: IDE"
# We can't use `team-reviewers` until we resolve https://github.com/gitpod-io/gitpod/issues/12194
# team-reviewers: "engineering-ide"
team-reviewers: "engineering-ide"
token: ${{ secrets.roboquatRepoPat }}
committer: Robo Quat <[email protected]>
author: Robo Quat <[email protected]>
- name: Auto Approve Pull Request
if: ${{ inputs.pluginId == 'backend-plugin' && steps.create-pr.outputs.pull-request-number }}
uses: hmarr/auto-approve-action@v3
with:
pull-request-number: ${{ steps.create-pr.outputs.pull-request-number }}
pull-request-number: ${{ steps.create-pr.outputs.pull-request-number }}
- name: Get previous job's status
id: lastrun
uses: filiptronicek/get-last-job-status@main
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/jetbrains-update-plugin-platform.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ jobs:
gradlePropertiesPath: components/ide/jetbrains/backend-plugin/gradle-latest.properties
secrets:
slackWebhook: ${{ secrets.IDE_SLACK_WEBHOOK }}
roboquatRepoPat: ${{ secrets.ROBOQUAT_REPO_PAT }}
update-gateway-plugin-platform:
uses: ./.github/workflows/jetbrains-update-plugin-platform-template.yml
with:
Expand All @@ -23,3 +24,4 @@ jobs:
gradlePropertiesPath: components/ide/jetbrains/gateway-plugin/gradle-latest.properties
secrets:
slackWebhook: ${{ secrets.IDE_SLACK_WEBHOOK }}
roboquatRepoPat: ${{ secrets.ROBOQUAT_REPO_PAT }}

0 comments on commit 6d6d1f9

Please sign in to comment.