Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
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
42 changes: 38 additions & 4 deletions .github/workflows/ensure_label.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,42 @@
# This workflow was originally pointing to a shared workflow in the puppetlabs/release-engineering-repo-standards repository.
# However, it has been copied here since the shared workflow is no longer publicly accessible.
#
# on: pull_request
# jobs:
# ensure_label:
# uses: puppetlabs/release-engineering-repo-standards/.github/workflows/ensure_label.yml@v1
# secrets: inherit

name: Ensure label

on: pull_request
on:
pull_request:

jobs:
ensure_label:
uses: puppetlabs/release-engineering-repo-standards/.github/workflows/ensure_label.yml@v1
secrets: inherit
label_exists:
name: Label Must Exist
runs-on: ubuntu-latest
steps:
- name: Check for Labels
uses: actions/github-script@v6
with:
script: |
async function getPullRequest() {
// Get current pull request labels
const { data: { labels } } = await github.rest.pulls.get({
owner: context.repo.owner,
repo: context.repo.repo,
pull_number: context.payload.number,
});

// Log found label names
for (const label of labels) {
core.info(`Found label named '${label.name}' on pull request number ${context.payload.number}`);
};

// Fail workflow if no labels exist
labelsExist = (labels.length === 0) ? false : true;
if (!labelsExist) core.setFailed(`Please ensure that a label exists on pull request number ${context.payload.number}`);
}

getPullRequest();
2 changes: 1 addition & 1 deletion beaker-pe.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ Gem::Specification.new do |s|
s.add_development_dependency 'thin'

# Run time dependencies
s.add_runtime_dependency 'beaker', '>= 4.0', '< 7'
s.add_runtime_dependency 'beaker', '>= 4.0', '< 8'
s.add_runtime_dependency 'beaker-puppet', '>=1'
s.add_runtime_dependency 'stringify-hash', '~> 0.0.0'
s.add_runtime_dependency 'beaker-answers', '~> 1.0'
Expand Down
Loading