Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

update triggers to use issues for opening docs issues #9803

Merged
merged 2 commits into from
Mar 22, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 8 additions & 10 deletions .github/workflows/docs-issue.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,36 +5,34 @@
# To reduce barriers for keeping docs up to date

# **when?**
# When a PR is labeled `user docs` and is merged. Runs on pull_request_target to run off the workflow already merged,
# not the workflow that existed on the PR branch. This allows old PRs to get comments.
# When an issue is labeled `user docs` and is closed as completed. Can be labeled before or after the issue is closed.


name: Open issues in docs.getdbt.com repo when a PR is labeled
run-name: "Open an issue in docs.getdbt.com for PR #${{ github.event.pull_request.number }}"

on:
pull_request_target:
issues:
types: [labeled, closed]

defaults:
run:
shell: bash

permissions:
issues: write # opens new issues
pull-requests: write # comments on PRs

issues: write # comments on issues

jobs:
open_issues:
# we only want to run this when the PR has been merged or the label in the labeled event is `user docs`. Otherwise it runs the
# we only want to run this when the is closed as completed and the label `user docs` has been assigned.
emmyoop marked this conversation as resolved.
Show resolved Hide resolved
# If this logic does nto exist in this workflow, it runs the
emmyoop marked this conversation as resolved.
Show resolved Hide resolved
# risk of duplicaton of issues being created due to merge and label both triggering this workflow to run and neither having
# generating the comment before the other runs. This lives here instead of the shared workflow because this is where we
# decide if it should run or not.
if: |
(github.event.pull_request.merged == true) &&
((github.event.action == 'closed' && contains( github.event.pull_request.labels.*.name, 'user docs')) ||
(github.event.action == 'labeled' && github.event.label.name == 'user docs'))
(github.event.issue.state == 'closed' &&
github.event.issue.state_reason == 'completed' &&
contains( github.event.pull_request.labels.*.name, 'user docs'))
uses: dbt-labs/actions/.github/workflows/open-issue-in-repo.yml@main
with:
issue_repository: "dbt-labs/docs.getdbt.com"
Expand Down
Loading