Skip to content

Commit

Permalink
convert to reusable action (#5565)
Browse files Browse the repository at this point in the history
* convert to reusable action

* fix branch name

* reimplemented changelog

* update to use workflow

* fix typo

* move def

* inherit secrets

* send in comment/label

* specify GITHUB_TOKEN

* Add automated changelog yaml from template for bot PR

* Delete Dependency-20220801-193810.yaml

* Add automated changelog yaml from template for bot PR

* remove dummy changelog

* remove token

* rename file

* point to main

Co-authored-by: Github Build Bot <[email protected]>
  • Loading branch information
emmyoop and FishtownBuildBot authored Aug 3, 2022
1 parent 4f5b9e6 commit 40b55ed
Show file tree
Hide file tree
Showing 3 changed files with 51 additions and 87 deletions.
20 changes: 11 additions & 9 deletions .github/_README.md
Original file line number Diff line number Diff line change
Expand Up @@ -143,19 +143,21 @@ Some triggers of note that we use:

- Print out all variables you will reference as the first step of a job. This allows for easier debugging. The first job should log all inputs. Subsequent jobs should reference outputs of other jobs, if present.

When possible, generate variables at the top of your workflow in a single place to reference later. This is not always strictly possible since you may generate a value to be used lated mid-workflow.
When possible, generate variables at the top of your workflow in a single place to reference later. This is not always strictly possible since you may generate a value to be used later mid-workflow.

Be sure to use quotes around these logs so special characters are not interpreted.

```yaml
job1:
- name: [DEBUG] Print Variables
- name: "[DEBUG] Print Variables"
run: |
echo "all variables defined as inputs"
echo The last commit sha in the release: ${{ inputs.sha }}
echo The release version number: ${{ inputs.version_number }}
echo The changelog_path: ${{ inputs.changelog_path }}
echo The build_script_path: ${{ inputs.build_script_path }}
echo The s3_bucket_name: ${{ inputs.s3_bucket_name }}
echo The package_test_command: ${{ inputs.package_test_command }}
echo "The last commit sha in the release: ${{ inputs.sha }}"
echo "The release version number: ${{ inputs.version_number }}"
echo "The changelog_path: ${{ inputs.changelog_path }}"
echo "The build_script_path: ${{ inputs.build_script_path }}"
echo "The s3_bucket_name: ${{ inputs.s3_bucket_name }}"
echo "The package_test_command: ${{ inputs.package_test_command }}"
# collect all the variables that need to be used in subsequent jobs
- name: Set Variables
Expand All @@ -167,7 +169,7 @@ Some triggers of note that we use:
job2:
needs: [job1]
- name: '[DEBUG] Print Variables'
- name: "[DEBUG] Print Variables"
run: |
echo "all variables defined in job1 > Set Variables > outputs"
echo "important_path: ${{ needs.job1.outputs.important_path }}"
Expand Down
78 changes: 0 additions & 78 deletions .github/workflows/changelog-check.yml

This file was deleted.

40 changes: 40 additions & 0 deletions .github/workflows/changelog-existence.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
# **what?**
# Checks that a file has been committed under the /.changes directory
# as a new CHANGELOG entry. Cannot check for a specific filename as
# it is dynamically generated by change type and timestamp.
# This workflow should not require any secrets since it runs for PRs
# from forked repos.
# By default, secrets are not passed to workflows running from
# a forked repo.

# **why?**
# Ensure code change gets reflected in the CHANGELOG.

# **when?**
# This will run for all PRs going into main and *.latest. It will
# run when they are opened, reopened, when any label is added or removed
# and when new code is pushed to the branch. The action will then get
# skipped if the 'Skip Changelog' label is present is any of the labels.

name: Check Changelog Entry

on:
pull_request:
types: [opened, reopened, labeled, unlabeled, synchronize]
workflow_dispatch:

defaults:
run:
shell: bash

permissions:
contents: read
pull-requests: write

jobs:
changelog:
uses: dbt-labs/actions/.github/workflows/changelog-existence.yml@main
with:
changelog_comment: 'Thank you for your pull request! We could not find a changelog entry for this change. For details on how to document a change, see [the contributing guide](https://github.com/dbt-labs/dbt-core/blob/main/CONTRIBUTING.md#adding-changelog-entry).'
skip_label: 'Skip Changelog'
secrets: inherit

0 comments on commit 40b55ed

Please sign in to comment.