mirror of
https://github.com/kemko/nomad.git
synced 2026-01-04 17:35:43 +03:00
* Updated actions * actions/checkout v4.1.1 ==> v4.1.7 * actions/download-artifact v3.0.2 ==> v4.1.7 * actions/setup-go v4.0.1 ==> v5.0.1 * actions/setup-node v3.7.0 ==> v4.0.2 * actions/upload-artifact v3.1.2 ==> v4.3.3 * andstor/file-existence-action v2.0.0 ==> v3.0.0 * browser-actions/setup-chrome v1.2.0 ==> v1.7.1 * dessant/lock-threads v4.0.1 ==> v5.0.1 * marocchino/sticky-pull-request-comment v2.6.2 ==> v2.9.0 * mshick/add-pr-comment v2.8.1 ==> v2.8.2 * nanasess/setup-chromedriver v2.1.2 ==> v2.2.2 * slackapi/slack-github-action v1.24.0 ==> v1.26.0 * Update HashiCorp actions * hashicorp/actions-docker-build v1 ==> v2.0.0 * hashicorp/actions-generate-metadata v1.1.1 ==> v1.1.1(pinned) * hashicorp/actions-packaging-linux v1 ==> v1.8.0 * hashicorp/setup-copywrite v1.1.2 ==> v1.1.3 * fix parameter
95 lines
3.7 KiB
YAML
95 lines
3.7 KiB
YAML
---
|
|
name: Backport Assistant Runner
|
|
|
|
on:
|
|
pull_request_target:
|
|
types:
|
|
- closed
|
|
- labeled
|
|
|
|
jobs:
|
|
backport:
|
|
if: github.event.pull_request.merged
|
|
runs-on: ubuntu-latest
|
|
container: hashicorpdev/backport-assistant:0.4.1
|
|
steps:
|
|
- name: Backport changes to stable-website
|
|
run: |
|
|
backport-assistant backport -merge-method=squash
|
|
env:
|
|
BACKPORT_LABEL_REGEXP: "backport/(?P<target>website)"
|
|
BACKPORT_TARGET_TEMPLATE: "stable-{{.target}}"
|
|
# Enabling this option increased the number of backport failures.
|
|
BACKPORT_MERGE_COMMIT: false
|
|
GITHUB_TOKEN: ${{ secrets.ELEVATED_GITHUB_TOKEN }}
|
|
- name: Backport changes to targeted release branch
|
|
run: |
|
|
backport-assistant backport -merge-method=squash
|
|
env:
|
|
BACKPORT_LABEL_REGEXP: "backport/(?P<target>\\d+\\.\\d+\\.[+\\w]+)"
|
|
BACKPORT_TARGET_TEMPLATE: "release/{{.target}}"
|
|
# Enabling this option increased the number of backport failures.
|
|
BACKPORT_MERGE_COMMIT: false
|
|
GITHUB_TOKEN: ${{ secrets.ELEVATED_GITHUB_TOKEN }}
|
|
ENABLE_VERSION_MANIFESTS: true
|
|
backport-ent:
|
|
if: github.event.pull_request.merged && contains(join(github.event.pull_request.labels.*.name), 'backport/ent')
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Trigger backport for Enterprise
|
|
uses: peter-evans/repository-dispatch@ff45666b9427631e3450c54a1bcbee4d9ff4d7c0 # v3.0.0
|
|
with:
|
|
token: ${{ secrets.ELEVATED_GITHUB_TOKEN }}
|
|
repository: hashicorp/nomad-enterprise
|
|
event-type: ent-backport
|
|
client-payload: ${{ toJson(github.event) }}
|
|
handle-failure:
|
|
needs:
|
|
- backport
|
|
- backport-ent
|
|
if: always() && (needs.backport.result == 'failure' || needs.backport-ent.result == 'failure')
|
|
runs-on: ${{ endsWith(github.repository, '-enterprise') && fromJSON('["self-hosted", "ondemand", "linux"]') || 'ubuntu-latest' }}
|
|
steps:
|
|
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
|
|
- uses: ./.github/actions/vault-secrets
|
|
with:
|
|
paths: |-
|
|
kv/data/teams/nomad/slack-webhooks feed-nomad | SLACK_FEED_NOMAD ;
|
|
- name: Send slack notification on failure
|
|
uses: slackapi/slack-github-action@70cd7be8e40a46e8b0eced40b0de447bdb42f68e # v1.26.0
|
|
with:
|
|
payload: |
|
|
{
|
|
"text": ":x::arrow_right_hook::nomad-sob: Backport run *FAILED*",
|
|
"attachments": [
|
|
{
|
|
"color": "#C41E3A",
|
|
"blocks": [
|
|
{
|
|
"type": "section",
|
|
"fields": [
|
|
{
|
|
"type": "mrkdwn",
|
|
"text": "*Pull Request:*\n<${{ github.event.pull_request.html_url}}|${{ github.repository }}#${{ github.event.pull_request.number}}>"
|
|
},
|
|
{
|
|
"type": "mrkdwn",
|
|
"text": "*From:*\n@${{ github.event.sender.login }}"
|
|
},
|
|
{
|
|
"type": "mrkdwn",
|
|
"text": "*Run:*\n<${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}|${{ github.run_id }}>"
|
|
}
|
|
]
|
|
}
|
|
]
|
|
}
|
|
]
|
|
}
|
|
env:
|
|
SLACK_WEBHOOK_URL: ${{ env.SLACK_FEED_NOMAD || secrets.BACKPORT_ASSISTANT_FAILURE_SLACK }}
|
|
SLACK_WEBHOOK_TYPE: INCOMING_WEBHOOK
|
|
permissions:
|
|
contents: read
|
|
id-token: write
|