This repository has been archived by the owner on Apr 18, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 316
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge remote-tracking branch 'origin/master' into new-pr-template
- Loading branch information
Showing
105 changed files
with
2,562 additions
and
438 deletions.
There are no files selected for viewing
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
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
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -36,18 +36,6 @@ jobs: | |
id: "cpu-info" | ||
run: echo "cores-count=$(cat /proc/cpuinfo | grep processor | wc -l)" >> $GITHUB_OUTPUT | ||
|
||
- name: Setup SSH agent | ||
env: | ||
SSH_AUTH_SOCK: /tmp/ssh_agent.sock | ||
SSH_DIR: /home/runner/.ssh | ||
run: | | ||
mkdir $SSH_DIR | ||
ssh-keyscan github.com >> $SSH_DIR/known_hosts | ||
echo "${{ secrets.SSH_PRIVATE_KEY }}" > $SSH_DIR/package_rsa | ||
chmod 600 $SSH_DIR/package_rsa | ||
ssh-agent -a $SSH_AUTH_SOCK > /dev/null | ||
ssh-add $SSH_DIR/package_rsa | ||
- name: Upgrade Yarn | ||
run: npm install -g [email protected] | ||
|
||
|
@@ -56,7 +44,7 @@ jobs: | |
run: echo "dir=$(yarn cache dir)" >> $GITHUB_OUTPUT | ||
|
||
- name: Configure yarn cache | ||
uses: actions/cache@v3 | ||
uses: actions/cache@v4 | ||
with: | ||
path: ${{ steps.yarn-cache-dir-path.outputs.dir }} | ||
key: ${{ env.CACHE_NAME_PREFIX }}-${{ runner.os }}-node-${{ env.NODE }}-${{ hashFiles('**/yarn.lock') }} | ||
|
@@ -91,8 +79,6 @@ jobs: | |
- name: "Setup Cypress" | ||
timeout-minutes: 1 | ||
env: | ||
SSH_AUTH_SOCK: /tmp/ssh_agent.sock | ||
run: | | ||
set -euo pipefail | ||
cd ./tests/functional | ||
|
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -13,10 +13,16 @@ jobs: | |
runs-on: ubuntu-latest | ||
timeout-minutes: 3 | ||
steps: | ||
- name: Dump the client payload context | ||
env: | ||
PAYLOAD_CONTEXT: ${{ toJson(github.event.client_payload) }} | ||
run: echo "$PAYLOAD_CONTEXT" | ||
- uses: hmarr/[email protected] | ||
|
||
- name: Add Workflow link to command comment | ||
uses: peter-evans/create-or-update-comment@v3 | ||
with: | ||
token: ${{ secrets.GIT_PAT }} | ||
repository: ${{ github.event.client_payload.github.payload.repository.full_name }} | ||
comment-id: ${{ github.event.client_payload.github.payload.comment.id }} | ||
body: | | ||
> [Workflow run](https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}) | ||
- name: Checkout on chat command | ||
uses: actions/checkout@v4 | ||
|
@@ -27,15 +33,20 @@ jobs: | |
submodules: 'recursive' | ||
fetch-depth: 0 | ||
|
||
- name: Configure git | ||
shell: bash | ||
run: | | ||
set -xeuo pipefail | ||
git config --global user.name '${{ github.event.client_payload.github.actor }}' | ||
git config --global user.email '${{ github.event.client_payload.github.actor }}@users.noreply.github.com' | ||
- name: Check for merge conflict | ||
id: check-conflict | ||
env: | ||
SLASH_COMMAND_ARG_BRANCH: ${{ github.event.client_payload.slash_command.args.unnamed.arg2 }} | ||
shell: bash | ||
run: | | ||
set -xeuo pipefail | ||
git config --global user.name '${{ github.event.client_payload.github.actor }}' | ||
git config --global user.email '${{ github.event.client_payload.github.actor }}@users.noreply.github.com' | ||
echo "merge_conflict=$(git merge-tree $(git merge-base HEAD origin/$SLASH_COMMAND_ARG_BRANCH) origin/$SLASH_COMMAND_ARG_BRANCH HEAD | grep '<<')" >> $GITHUB_OUTPUT | ||
- name: Add reaction to command comment on merge conflict | ||
|
@@ -46,9 +57,7 @@ jobs: | |
repository: ${{ github.event.client_payload.github.payload.repository.full_name }} | ||
comment-id: ${{ github.event.client_payload.github.payload.comment.id }} | ||
body: | | ||
> **Error**: Merge conflict detected, please resolve it using the git command line. | ||
> | ||
> [Workflow run](https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}) | ||
> **Error**: Merge conflict detected, please resolve it using the command line. | ||
reactions: "-1" | ||
|
||
- name: Merge branch into current branch | ||
|
@@ -79,8 +88,6 @@ jobs: | |
comment-id: ${{ github.event.client_payload.github.payload.comment.id }} | ||
body: | | ||
> Already up-to-date. Nothing to commit. | ||
> | ||
> [Workflow run](https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}) | ||
reactions: "confused" | ||
|
||
- name: Add reaction to command comment on success | ||
|
@@ -93,8 +100,6 @@ jobs: | |
body: | | ||
> Successfully pushed new changes: | ||
> ${{ steps.commit_and_push.outputs.last_commit_msg }} (${{ steps.commit_and_push.outputs.last_commit_sha }}) | ||
> | ||
> [Workflow run](https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}) | ||
reactions: "+1" | ||
|
||
- name: Add reaction to command comment on failure | ||
|
@@ -106,8 +111,6 @@ jobs: | |
comment-id: ${{ github.event.client_payload.github.payload.comment.id }} | ||
body: | | ||
> **Error**: failed to execute "${{ github.event.client_payload.slash_command.args.unnamed.arg1 }}" command | ||
> | ||
> [Workflow run](https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}) | ||
reactions: "-1" | ||
|
||
help: | ||
|
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,103 @@ | ||
name: "/jira command" | ||
|
||
on: | ||
repository_dispatch: | ||
types: [ jira-command ] | ||
|
||
concurrency: | ||
group: ${{ github.workflow }}-${{ github.event.client_payload.github.payload.issue.number }}-${{ github.event.client_payload.slash_command.command }}-${{ github.event.client_payload.slash_command.args.unnamed.arg1 || github.event.client_payload.slash_command.args.all }} | ||
|
||
jobs: | ||
create: | ||
if: ${{ github.event.client_payload.slash_command.args.unnamed.arg1 == 'create' }} | ||
runs-on: ubuntu-latest | ||
timeout-minutes: 3 | ||
steps: | ||
- uses: hmarr/[email protected] | ||
|
||
- name: Add Workflow link to command comment | ||
uses: peter-evans/create-or-update-comment@v3 | ||
with: | ||
token: ${{ secrets.GIT_PAT }} | ||
repository: ${{ github.event.client_payload.github.payload.repository.full_name }} | ||
comment-id: ${{ github.event.client_payload.github.payload.comment.id }} | ||
body: | | ||
> [Workflow run](https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}) | ||
- name: Check user's membership | ||
uses: actions/github-script@v7 | ||
id: check-membership | ||
env: | ||
ACTOR: ${{ github.actor }} | ||
with: | ||
github-token: ${{ secrets.GIT_PAT }} | ||
script: | | ||
const { repo, owner } = context.repo; | ||
const actor = process.env.ACTOR; | ||
const { data: membership } = await github.rest.orgs.getMembershipForUser({ | ||
org: owner, | ||
username: actor, | ||
}); | ||
if (membership.state != "active") { | ||
const error = `Unfortunately you don't have membership in ${owner} organization, Jira Issue was not created`; | ||
core.setOutput("error", error); | ||
core.setFailed(error); | ||
} | ||
- name: Checkout Actions Hub | ||
uses: actions/checkout@v4 | ||
with: | ||
token: ${{ secrets.GIT_PAT }} | ||
repository: HumanSignal/actions-hub | ||
path: ./.github/actions-hub | ||
|
||
- name: Jira Create Issue | ||
id: jira-create-issue | ||
uses: ./.github/actions-hub/actions/jira-create-issue | ||
with: | ||
jira_server: ${{ vars.JIRA_SERVER }} | ||
jira_username: ${{ secrets.JIRA_USERNAME }} | ||
jira_token: ${{ secrets.JIRA_TOKEN }} | ||
summary: ${{ github.event.client_payload.github.payload.issue.title }} | ||
description: ${{ github.event.client_payload.github.payload.issue.body }} | ||
project: ${{ github.event.client_payload.slash_command.args.unnamed.arg3 || 'TRIAG' }} | ||
type: ${{ github.event.client_payload.slash_command.args.unnamed.arg2 || 'task' }} | ||
|
||
- name: Add reaction to command comment on success | ||
uses: peter-evans/create-or-update-comment@v3 | ||
with: | ||
token: ${{ secrets.GIT_PAT }} | ||
repository: ${{ github.event.client_payload.github.payload.repository.full_name }} | ||
comment-id: ${{ github.event.client_payload.github.payload.comment.id }} | ||
body: | | ||
> Jira issue [${{ steps.jira-create-issue.outputs.key }}](${{ steps.jira-create-issue.outputs.link }}) is created | ||
reactions: "+1" | ||
|
||
- name: Add reaction to command comment on failure | ||
uses: peter-evans/create-or-update-comment@v3 | ||
if: failure() | ||
with: | ||
token: ${{ secrets.GIT_PAT }} | ||
repository: ${{ github.event.client_payload.github.payload.repository.full_name }} | ||
comment-id: ${{ github.event.client_payload.github.payload.comment.id }} | ||
body: | | ||
> **Error**: failed to execute "${{ github.event.client_payload.slash_command.args.unnamed.arg1 }}" command | ||
> ${{ steps.check-membership.outputs.error }} | ||
reactions: "-1" | ||
|
||
help: | ||
if: github.event.client_payload.slash_command.args.unnamed.arg1 == 'help' || !contains(fromJson('["create"]'), github.event.client_payload.slash_command.args.unnamed.arg1) | ||
runs-on: ubuntu-latest | ||
timeout-minutes: 1 | ||
steps: | ||
- name: Update comment | ||
uses: peter-evans/create-or-update-comment@v3 | ||
with: | ||
token: ${{ secrets.GIT_PAT }} | ||
repository: ${{ github.event.client_payload.github.payload.repository.full_name }} | ||
comment-id: ${{ github.event.client_payload.github.payload.comment.id }} | ||
body: | | ||
> Command | Description | ||
> --- | --- | ||
> /jira create [task|bug|story] `PROJECT` | Create a Jira issue in project `PROJECT` | ||
reaction-type: hooray |
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
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
Oops, something went wrong.