diff --git a/.github/workflows/label-github-issues-by-context.yml b/.github/workflows/label-github-issues.yml similarity index 72% rename from .github/workflows/label-github-issues-by-context.yml rename to .github/workflows/label-github-issues.yml index 82a0800b683a..f23361864fe6 100644 --- a/.github/workflows/label-github-issues-by-context.yml +++ b/.github/workflows/label-github-issues.yml @@ -8,15 +8,19 @@ 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_4_ROOT_ACCESS }} \ - ${{ secrets.OCTAVIA_PAT }} + ${{ secrets.OCTAVIA_PAT }} \ + ${{ secrets.OCTAVIA_4_ROOT_ACCESS }} shared-issues: name: "Add Labels to Issues. Safe to Merge on fail" runs-on: ubuntu-latest @@ -27,7 +31,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 - token: "${{ env.PAT }}" + # the following input gets passed to the private action + token: "${{ needs.find_valid_pat.outputs.pat }}" # ref: https://github.com/airbytehq/workflow-actions/blob/main/src/bin_issue.ts command: "issue" diff --git a/.github/workflows/label-prs-by-context.yml b/.github/workflows/label-prs-by-context.yml deleted file mode 100644 index fddd5e28f288..000000000000 --- a/.github/workflows/label-prs-by-context.yml +++ /dev/null @@ -1,32 +0,0 @@ -# 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" diff --git a/.github/workflows/label-github-issues-by-path.yml b/.github/workflows/labeler.yml similarity index 83% rename from .github/workflows/label-github-issues-by-path.yml rename to .github/workflows/labeler.yml index d59067a093ea..e1761c4c1771 100644 --- a/.github/workflows/label-github-issues-by-path.yml +++ b/.github/workflows/labeler.yml @@ -1,5 +1,5 @@ # the mapping from filepath to label -# is defined in .github/label-github-issues-by-path.yml +# is defined in .github/labeler.yml name: "Label PR based on filepath" on: diff --git a/.github/workflows/notify-on-label.yml b/.github/workflows/notify-on-label.yml index cc7fb126fe4c..6d47413f7e55 100644 --- a/.github/workflows/notify-on-label.yml +++ b/.github/workflows/notify-on-label.yml @@ -1,32 +1,18 @@ # Notify users/teams when labels are added to an issue. -name: Notify FE team for FE label on issues +name: Notify when adding label to issue 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: "${{ env.PAT }}" + token: ${{ secrets.OCTAVIA_PAT }} message: 'cc {recipients}' # Specify a map of label -> team/user to notify recipients: | diff --git a/.github/workflows/notify-on-push-to-master.yml b/.github/workflows/notify-on-push-to-master.yml index 6dcbfdefb92c..48f3a8f35271 100644 --- a/.github/workflows/notify-on-push-to-master.yml +++ b/.github/workflows/notify-on-push-to-master.yml @@ -1,4 +1,4 @@ -name: Trigger action in cloud based on push +name: Notify Cloud of OSS Push to Master on: push: branches: @@ -6,29 +6,13 @@ on: 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: ${{ env.pat }} + token: ${{ secrets.OCTAVIA_PAT }} repository: airbytehq/airbyte-cloud event-type: oss-push-to-master client-payload: '{"ref": "${{ github.ref }}", "sha": "${{ github.sha }}"}' diff --git a/.github/workflows/shared-pulls.yml b/.github/workflows/shared-pulls.yml new file mode 100644 index 000000000000..23c065ed7b3b --- /dev/null +++ b/.github/workflows/shared-pulls.yml @@ -0,0 +1,18 @@ +# Runs internal automation for pull requests + +name: "Add metadata and labels to PRs based on context" +on: + pull_request_target: + types: [opened, labeled, unlabeled, ready_for_review, synchronize, reopened] + +jobs: + shared-pulls: + 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: "${{ secrets.OCTAVIA_PAT }}" + command: "pull"