chore: [FX-4058] update jira deployments GH Action #1
Workflow file for this run
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
on: | |
# push: | |
# branches: | |
# - main | |
pull_request: | |
branches: | |
- master # triggers the flow for every PR to master | |
- 'feature/**' # triggers the flow for a PR to a branch like feature/v9 | |
types: | |
- synchronize # PR was updated | |
- opened # PR was open | |
- reopened # PR was closed and is now open again | |
- ready_for_review # PR was converted from draft to open | |
jobs: | |
create-jira-deployment: | |
runs-on: ubuntu-latest | |
name: Create JIRA deployment | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
APP_NAME: picasso | |
ENV_NAME: temploy | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v2 | |
- id: branch | |
uses: xt0rted/[email protected] | |
- name: Track deployment | |
run: | | |
BASE_REF="${{ steps.branch.outputs.base_ref }}" | |
HEAD_REF="${{ steps.branch.outputs.head_ref }}" | |
# Get issue keys | |
ISSUE_KEYS=$(docker run --rm --pull=always \ | |
-e GITHUB_TOKEN=$GITHUB_TOKEN \ | |
-e OWNER=toptal \ | |
-e REPO=$APP_NAME \ | |
-e BASEREF=$BASE_REF \ | |
-e HEADREF=$HEAD_REF \ | |
us-central1-docker.pkg.dev/toptal-hub/containers/githist2jirakeys:v1.0) | |
# Send deployment info to JIRA | |
if [ -n "$ISSUE_KEYS" ]; then | |
# Replace this with the appropriate command to send deployment info to JIRA | |
echo "Sending deployment info to JIRA: $ISSUE_KEYS" | |
else | |
echo "No issue keys found, skipping deployment reporting" | |
fi |