Skip to content

Commit

Permalink
Toph cleans up labellers ii (#17330)
Browse files Browse the repository at this point in the history
* Further testing

This reverts commit 83cdf19.

* Moves find_valid_pat into single job

* Removes duplicate find_valid_pat

* Moves find_valid_pat to single job

* New name for FE notifier
  • Loading branch information
supertopher authored Sep 28, 2022
1 parent 83cdf19 commit 7fad702
Show file tree
Hide file tree
Showing 7 changed files with 86 additions and 66 deletions.
27 changes: 27 additions & 0 deletions .github/workflows/label-github-issues-by-context.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: "Add labels to github issues based on context"
on:
issues:
types: [opened, labeled, unlabeled]

jobs:
shared-issues:
name: "Add Labels to Issues. Safe to Merge on fail"
runs-on: ubuntu-latest
steps:
- name: Checkout Airbyte Repo for PAT command
uses: actions/checkout@v2
- name: Check PAT rate limits
# Cannot share PAT outside of JOB context
run: |
./tools/bin/find_non_rate_limited_PAT \
${{ secrets.OCTAVIA_4_ROOT_ACCESS }} \
${{ secrets.OCTAVIA_PAT }}
- name: Run Issue Command from workflow-actions
uses: nick-fields/private-action-loader@v3
with:
pal-repo-token: "${{ env.PAT }}"
pal-repo-name: airbytehq/workflow-actions@production
# the following input gets passed to the private
token: "${{ env.PAT }}"
# ref: https://github.com/airbytehq/workflow-actions/blob/main/src/bin_issue.ts
command: "issue"
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# the mapping from filepath to label
# is defined in .github/labeler.yml
# is defined in .github/label-github-issues-by-path.yml

name: "Label PR based on filepath"
on:
Expand Down
37 changes: 0 additions & 37 deletions .github/workflows/label-github-issues.yml

This file was deleted.

28 changes: 28 additions & 0 deletions .github/workflows/label-prs-by-context.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# Runs internal automation for pull requests

name: "Add labels to github PRs based on context"
on:
pull_request_target:
types: [opened, labeled, unlabeled, ready_for_review, synchronize, reopened]

jobs:
shared-pr-labeller:
name: "Add Labels to PRs. Safe to Merge on fail"
runs-on: ubuntu-latest
steps:
- name: Checkout Airbyte Repo for PAT command
uses: actions/checkout@v2
- name: Check PAT rate limits
# Cannot share PAT outside of JOB context
run: |
./tools/bin/find_non_rate_limited_PAT \
${{ secrets.OCTAVIA_4_ROOT_ACCESS }} \
${{ secrets.OCTAVIA_PAT }}
- name: Run Issue Command from workflow-actions
uses: nick-fields/private-action-loader@v3
with:
pal-repo-token: "${{ env.PAT }}"
pal-repo-name: airbytehq/workflow-actions@production
# the following input gets passed to the private action
token: "${{ env.PAT }}"
command: "pull"
27 changes: 19 additions & 8 deletions .github/workflows/notify-on-label.yml
Original file line number Diff line number Diff line change
@@ -1,19 +1,30 @@
# Notify users/teams when labels are added to an issue.

name: Notify when adding label to issue
name: Notify FE team for FE label on issues

on:
issues:
types: [labeled]

jobs:
notify:
name: "Notify FE team on label creation"
runs-on: ubuntu-latest
steps:
- uses: jenschelkopf/issue-label-notification-action@1.3
with:
token: ${{ secrets.OCTAVIA_PAT }}
message: 'cc {recipients}'
# Specify a map of label -> team/user to notify
recipients: |
team/frontend=@airbytehq/frontend
- name: Checkout Airbyte Repo for PAT command
uses: actions/checkout@v2
- name: Check PAT rate limits
# Cannot share PAT outside of JOB context
run: |
./tools/bin/find_non_rate_limited_PAT \
${{ secrets.OCTAVIA_4_ROOT_ACCESS }} \
${{ secrets.OCTAVIA_PAT }}
# Updated name to reflect reality. Update name if you change recipients
- name: Notify FE team when on FE label creation
uses: jenschelkopf/issue-label-notification-action@1.3
with:
token: "${{ env.PAT }}"
message: 'cc {recipients}'
# Specify a map of label -> team/user to notify
recipients: |
team/frontend=@airbytehq/frontend
13 changes: 11 additions & 2 deletions .github/workflows/notify-on-push-to-master.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Notify Cloud of OSS Push to Master
name: Trigger action in cloud based on push
on:
push:
branches:
Expand All @@ -7,12 +7,21 @@ on:

jobs:
repo-sync:
name: "Fire a Repo Dispatch event to airbyte-cloud"
runs-on: ubuntu-latest
steps:
- name: Checkout Airbyte Repo for PAT command
uses: actions/checkout@v2
- name: Check PAT rate limits
# Cannot share PAT outside of JOB context
run: |
./tools/bin/find_non_rate_limited_PAT \
${{ secrets.OCTAVIA_4_ROOT_ACCESS }} \
${{ secrets.OCTAVIA_PAT }}
- name: Repository Dispatch
uses: peter-evans/repository-dispatch@v2
with:
token: ${{ secrets.OCTAVIA_PAT }}
token: ${{ env.pat }}
repository: airbytehq/airbyte-cloud
event-type: oss-push-to-master
client-payload: '{"ref": "${{ github.ref }}", "sha": "${{ github.sha }}"}'
18 changes: 0 additions & 18 deletions .github/workflows/shared-pulls.yml

This file was deleted.

0 comments on commit 7fad702

Please sign in to comment.