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 44
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' into fb-lsdv-4864/magic-wand-mig
- Loading branch information
Showing
89 changed files
with
4,713 additions
and
3,283 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -13,29 +13,40 @@ 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@v3 | ||
uses: actions/checkout@v4 | ||
with: | ||
token: ${{ secrets.GIT_PAT }} | ||
repository: ${{ github.event.client_payload.pull_request.head.repo.full_name }} | ||
ref: ${{ github.event.client_payload.pull_request.head.ref }} | ||
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -19,13 +19,13 @@ jobs: | |
runs-on: ubuntu-latest | ||
steps: | ||
- uses: hmarr/[email protected] | ||
- uses: thehanimo/pr-title-checker@v1.3.7 | ||
- uses: thehanimo/pr-title-checker@v1.4.1 | ||
name: "Validate PR's title" | ||
with: | ||
GITHUB_TOKEN: ${{ secrets.GIT_PAT }} | ||
pass_on_octokit_error: false | ||
configuration_path: ".github/pr-title-checker-config.json" | ||
- uses: release-drafter/release-drafter@v5.23.0 | ||
- uses: release-drafter/release-drafter@v5.25.0 | ||
name: "Set PR's label based on title" | ||
with: | ||
disable-releaser: true | ||
|
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 |
---|---|---|
@@ -1,4 +1,4 @@ | ||
name: Sync PR LS | ||
name: 'Follow Merge: Sync PR LSO' | ||
|
||
on: | ||
pull_request_target: | ||
|
@@ -16,8 +16,8 @@ concurrency: | |
group: ${{ github.workflow }}-${{ github.head_ref }} | ||
|
||
env: | ||
DOWNSTREAM_REPO_OWNER: heartexlabs | ||
DOWNSTREAM_REPO: label-studio | ||
DOWNSTREAM_REPOSITORY: "label-studio" | ||
DOWNSTREAM_EVENT_TYPE: "upstream_repo_update" | ||
|
||
jobs: | ||
sync: | ||
|
@@ -28,33 +28,44 @@ jobs: | |
- uses: hmarr/[email protected] | ||
|
||
- name: Sync PR | ||
uses: actions/github-script@v6 | ||
uses: actions/github-script@v7 | ||
id: sync-pr | ||
env: | ||
TITLE: ${{ github.event.pull_request.title }} | ||
HEAD_REF: ${{ github.head_ref }} | ||
BASE_REF: ${{ github.base_ref }} | ||
PR_HEAD_REPOSITORY: ${{ github.event.pull_request.head.repo.full_name || github.repository }} | ||
DOWNSTREAM_REPOSITORY: ${{ env.DOWNSTREAM_REPOSITORY }} | ||
DOWNSTREAM_EVENT_TYPE: ${{ env.DOWNSTREAM_EVENT_TYPE }} | ||
with: | ||
github-token: ${{ secrets.GIT_PAT }} | ||
script: | | ||
const [owner, repo] = '${{ github.event.pull_request.head.repo.full_name || github.repository }}'.split('/'); | ||
let event_action = '${{ github.event.action }}' | ||
let commit_sha = '${{ github.event.pull_request.head.sha }}' | ||
const { repo, owner } = context.repo; | ||
const pr_head_repository = process.env.PR_HEAD_REPOSITORY; | ||
const downstream_repository = process.env.DOWNSTREAM_REPOSITORY; | ||
const downstream_event_type = process.env.DOWNSTREAM_EVENT_TYPE; | ||
const [pr_owner, pr_repo] = pr_head_repository.split('/'); | ||
const head_ref = process.env.HEAD_REF; | ||
const base_ref = process.env.BASE_REF; | ||
let event_action = '${{ github.event.action }}'; | ||
let commit_sha = '${{ github.event.pull_request.head.sha }}'; | ||
if (${{ github.event.pull_request.merged }}) { | ||
event_action = 'merged' | ||
commit_sha = '${{ github.sha }}' | ||
event_action = 'merged'; | ||
commit_sha = '${{ github.sha }}'; | ||
} | ||
const getCommitResponse = await github.rest.repos.getCommit({ | ||
owner, | ||
repo, | ||
owner: pr_owner, | ||
repo: pr_repo, | ||
ref: commit_sha | ||
}); | ||
const result = await github.rest.repos.createDispatchEvent({ | ||
owner: '${{ env.DOWNSTREAM_REPO_OWNER }}', | ||
repo: '${{ env.DOWNSTREAM_REPO }}', | ||
event_type: 'upstream_repo_update', | ||
owner: owner, | ||
repo: downstream_repository, | ||
event_type: downstream_event_type, | ||
client_payload: { | ||
branch_name: '${{ github.head_ref }}', | ||
base_branch_name: '${{ github.base_ref }}', | ||
repo_name: '${{ github.event.pull_request.head.repo.full_name || github.repository }}', | ||
branch_name: head_ref, | ||
base_branch_name: base_ref, | ||
repo_name: '${{ github.repository }}', | ||
commit_sha : commit_sha, | ||
title: process.env.TITLE, | ||
html_url: '${{ github.event.pull_request.html_url }}', | ||
|
Oops, something went wrong.