Skip to content

Commit

Permalink
chore: update changeset gha workflow to include missing jira ticket c…
Browse files Browse the repository at this point in the history
…omment (#13547)
  • Loading branch information
momentmaker authored Jun 13, 2024
1 parent a6f2cb4 commit e400b39
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
5 changes: 5 additions & 0 deletions .github/scripts/jira/update-jira-issue.js
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,10 @@ async function run() {
core.notice(
"No JIRA issue number found in: PR title, commit message, or branch name. Please include the issue ID in one of these."
);
core.setOutput(
"jiraComment",
"> :medal_military: No JIRA issue number found - Please include it in the PR title or in a commit message."
);
return;
}
const fixVersionName = `chainlink-v${chainlinkVersion}`;
Expand All @@ -105,6 +109,7 @@ async function run() {
tags,
fixVersionName
);
core.setOutput("jiraComment", "");
} catch (error) {
core.setFailed(error.message);
}
Expand Down
5 changes: 5 additions & 0 deletions .github/workflows/changeset.yml
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,7 @@ jobs:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Update Jira ticket for core
id: jira
if: ${{ steps.files-changed.outputs.core == 'true' || steps.files-changed.outputs.shared == 'true' }}
shell: bash
working-directory: ./.github/scripts/jira
Expand All @@ -108,10 +109,12 @@ jobs:
if: ${{ steps.files-changed.outputs.core == 'true' || steps.files-changed.outputs.shared == 'true' }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
JIRA_COMMENT: ${{ steps.jira.outputs.jiraComment }}
with:
message: |
I see you updated files related to `core`. Please run `pnpm changeset` in the root directory to add a changeset as well as in the text include at least one of the following tags:
${{ env.TAGS }}
${{ env.JIRA_COMMENT }}
reactions: eyes
comment_tag: changeset-core
mode: ${{ steps.files-changed.outputs.core-changeset == 'false' && 'upsert' || 'delete' }}
Expand Down Expand Up @@ -149,10 +152,12 @@ jobs:
if: ${{ steps.files-changed.outputs.core-changeset == 'true' }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
JIRA_COMMENT: ${{ steps.jira.outputs.jiraComment }}
with:
message: |
I see you added a changeset file but it does not contain a tag. Please edit the text include at least one of the following tags:
${{ env.TAGS }}
${{ env.JIRA_COMMENT }}
reactions: eyes
comment_tag: changeset-core-tags
mode: ${{ steps.changeset-tags.outputs.has_tags == 'false' && 'upsert' || 'delete' }}
Expand Down

0 comments on commit e400b39

Please sign in to comment.