Skip to content

Commit

Permalink
Cleans up label actions && fix broken action (#17324)
Browse files Browse the repository at this point in the history
* Cleans up label actions

Also fixes my very silly implementation

* removes unsused output

* Keep titles the same across jerbs
  • Loading branch information
supertopher authored Sep 28, 2022
1 parent f006edb commit dd95d3a
Show file tree
Hide file tree
Showing 6 changed files with 71 additions and 31 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -8,19 +8,15 @@ jobs:
name: "Find a PAT with room for actions"
timeout-minutes: 10
runs-on: ubuntu-latest
outputs:
pat: ${{ steps.variables.outputs.pat }}
steps:
- name: UUID ${{ github.event.inputs.uuid }}
run: true
- name: Checkout Airbyte
uses: actions/checkout@v2
- name: Check PAT rate limits
id: variables
run: |
./tools/bin/find_non_rate_limited_PAT \
${{ secrets.OCTAVIA_PAT }} \
${{ secrets.OCTAVIA_4_ROOT_ACCESS }}
${{ secrets.OCTAVIA_4_ROOT_ACCESS }} \
${{ secrets.OCTAVIA_PAT }}
shared-issues:
name: "Add Labels to Issues. Safe to Merge on fail"
runs-on: ubuntu-latest
Expand All @@ -31,7 +27,7 @@ jobs:
with:
pal-repo-token: "${{ needs.find_valid_pat.outputs.pat }}"
pal-repo-name: airbytehq/workflow-actions@production
# the following input gets passed to the private action
token: "${{ needs.find_valid_pat.outputs.pat }}"
# 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
32 changes: 32 additions & 0 deletions .github/workflows/label-prs-by-context.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
# 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:
find_valid_pat:
name: "Find a PAT with room for actions"
timeout-minutes: 10
runs-on: ubuntu-latest
steps:
- name: Checkout Airbyte
uses: actions/checkout@v2
- name: Check PAT rate limits
id: variables
run: |
./tools/bin/find_non_rate_limited_PAT \
${{ secrets.OCTAVIA_4_ROOT_ACCESS }} \
${{ secrets.OCTAVIA_PAT }}
shared-pr-labeller:
name: "Add Labels to PRs. Safe to Merge on fail"
runs-on: ubuntu-latest
steps:
- uses: nick-fields/private-action-loader@v3
with:
pal-repo-token: "${{ secrets.OCTAVIA_PAT }}"
pal-repo-name: airbytehq/workflow-actions@production
# the following input gets passed to the private action
token: "${{ env.PAT }}"
command: "pull"
18 changes: 16 additions & 2 deletions .github/workflows/notify-on-label.yml
Original file line number Diff line number Diff line change
@@ -1,18 +1,32 @@
# 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:
find_valid_pat:
name: "Find a PAT with room for actions"
timeout-minutes: 10
runs-on: ubuntu-latest
steps:
- name: Checkout Airbyte
uses: actions/checkout@v2
- name: Check PAT rate limits
id: variables
run: |
./tools/bin/find_non_rate_limited_PAT \
${{ secrets.OCTAVIA_4_ROOT_ACCESS }} \
${{ secrets.OCTAVIA_PAT }}
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 }}
token: "${{ env.PAT }}"
message: 'cc {recipients}'
# Specify a map of label -> team/user to notify
recipients: |
Expand Down
20 changes: 18 additions & 2 deletions .github/workflows/notify-on-push-to-master.yml
Original file line number Diff line number Diff line change
@@ -1,18 +1,34 @@
name: Notify Cloud of OSS Push to Master
name: Trigger action in cloud based on push
on:
push:
branches:
- master
workflow_dispatch:

jobs:
find_valid_pat:
name: "Find a PAT with room for actions"
timeout-minutes: 10
runs-on: ubuntu-latest
outputs:
pat: ${{ steps.variables.outputs.pat }}
steps:
- name: Checkout Airbyte
uses: actions/checkout@v2
- name: Check PAT rate limits
id: variables
run: |
./tools/bin/find_non_rate_limited_PAT \
${{ secrets.OCTAVIA_4_ROOT_ACCESS }} \
${{ secrets.OCTAVIA_PAT }}
repo-sync:
name: "Fire a Repo Dispatch event to airbyte-cloud"
runs-on: ubuntu-latest
steps:
- 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 dd95d3a

Please sign in to comment.