Skip to content

Commit

Permalink
devops: Patching the pr issue status change pipeline
Browse files Browse the repository at this point in the history
  • Loading branch information
devopsjavelin committed Jan 20, 2025
1 parent d92df4c commit 4d1ad3a
Showing 1 changed file with 39 additions and 39 deletions.
78 changes: 39 additions & 39 deletions .github/workflows/pr-issues-status.yml
Original file line number Diff line number Diff line change
Expand Up @@ -130,44 +130,44 @@ jobs:
# PR_ISSUE_STATUS_ID=$(gh project field-list ${{ env.PROJECT_NUMBER }} --owner ${{ github.repository_owner }} -L ${{ env.OUTPUT_LIMIT }} --format json | jq -r '.fields[] | select(.id == "${ISSUE_FIELD_ID}") | .options[] | select(.name == "${{ env.PR_ISSUE_STATUS }}") | .id')
# gh project item-edit --id "${{ env.GLOBAL_ISSUE_ID }}" --field-id "${ISSUE_FIELD_ID}" --single-select-option-id "${PR_ISSUE_STATUS_ID}" --project-id "${PROJECT_ID}"

javelin-notify:
needs:
- javelin-env
- javelin-issue-status
permissions:
contents: 'read'
id-token: 'write'
runs-on: ubuntu-24.04
if: ${{ always() && (github.event.pull_request.merged == true) && (needs.javelin-issue-status.result != 'success') }}
env:
SVC_NAME: ${{ needs.javelin-env.outputs.svc_name }}
SLACK_CHANNEL_ID: ${{ needs.javelin-env.outputs.slack_release_channel_id }}
JOB_STATUS: ${{ needs.javelin-issue-status.result }}
JOB_STATUS_MARK: ":x:"
PR_URL: "https://github.com/${{ github.repository }}/pull/${{ github.event.number }}"
BUILD_URL: "${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}"
PR_AUTHOR: ${{ github.event.pull_request.user.login }}
SLACK_PAYLOAD_JSON: slack-pr-issue-status-payload.json
steps:
- name: DevOps Repository Checkout
uses: actions/checkout@v4
with:
repository: "${{ github.repository_owner }}/${{ env.DEVOPS_REPO }}"
token: ${{ secrets.DEVOPS_GITHUB_TOKEN }}
fetch-depth: 0
persist-credentials: false
ref: ${{ env.DEVOPS_BRANCH }}
path: ${{ env.DEVOPS_REPO }}
# javelin-notify:
# needs:
# - javelin-env
# - javelin-issue-status
# permissions:
# contents: 'read'
# id-token: 'write'
# runs-on: ubuntu-24.04
# if: ${{ always() && (github.event.pull_request.merged == true) && (needs.javelin-issue-status.result != 'success') }}
# env:
# SVC_NAME: ${{ needs.javelin-env.outputs.svc_name }}
# SLACK_CHANNEL_ID: ${{ needs.javelin-env.outputs.slack_release_channel_id }}
# JOB_STATUS: ${{ needs.javelin-issue-status.result }}
# JOB_STATUS_MARK: ":x:"
# PR_URL: "https://github.com/${{ github.repository }}/pull/${{ github.event.number }}"
# BUILD_URL: "${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}"
# PR_AUTHOR: ${{ github.event.pull_request.user.login }}
# SLACK_PAYLOAD_JSON: slack-pr-issue-status-payload.json
# steps:
# - name: DevOps Repository Checkout
# uses: actions/checkout@v4
# with:
# repository: "${{ github.repository_owner }}/${{ env.DEVOPS_REPO }}"
# token: ${{ secrets.DEVOPS_GITHUB_TOKEN }}
# fetch-depth: 0
# persist-credentials: false
# ref: ${{ env.DEVOPS_BRANCH }}
# path: ${{ env.DEVOPS_REPO }}

- name: Slack Payload Template
shell: bash
run: |-
envsubst < ${{ env.DEVOPS_REPO }}/slack-notify/${{ env.SLACK_PAYLOAD_JSON }} > ${{ env.SLACK_PAYLOAD_JSON }}
cat ${{ env.SLACK_PAYLOAD_JSON }}
# - name: Slack Payload Template
# shell: bash
# run: |-
# envsubst < ${{ env.DEVOPS_REPO }}/slack-notify/${{ env.SLACK_PAYLOAD_JSON }} > ${{ env.SLACK_PAYLOAD_JSON }}
# cat ${{ env.SLACK_PAYLOAD_JSON }}

- name: Slack Notification
uses: slackapi/[email protected]
with:
method: chat.postMessage
token: ${{ secrets.SLACK_BOT_TOKEN }}
payload-file-path: "${{ env.SLACK_PAYLOAD_JSON }}"
# - name: Slack Notification
# uses: slackapi/[email protected]
# with:
# method: chat.postMessage
# token: ${{ secrets.SLACK_BOT_TOKEN }}
# payload-file-path: "${{ env.SLACK_PAYLOAD_JSON }}"

0 comments on commit 4d1ad3a

Please sign in to comment.