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

Use actions-ecosystem/action-add/remove-labels #75

Merged
merged 4 commits into from
Apr 3, 2023
Merged
Changes from 2 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
26 changes: 8 additions & 18 deletions check-cla/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -76,31 +76,21 @@ runs:
core.setOutput('contributors', contributors);
core.setOutput('hasSigned', hasSigned);

# add cla-signed label if actor has already signed
# add [cla-signed] label if actor has already signed
- name: Add label
uses: actions/github-script@v6
uses: actions-ecosystem/action-add-labels@18f1af5e3544586314bbe15c0273249c770b2daf
if: steps.contributors.outputs.hasSigned == 'true' && steps.pr.outputs.hasLabel == 'false'
with:
github-token: ${{ inputs.token }}
script: |
await github.rest.issues.addLabels({
...context.repo,
issue_number: context.issue.number,
labels: ['${{ inputs.label }}']
})
github_token: ${{ inputs.token }}
labels: ${{ inputs.label }}

# remove cla-signed label if actor has not signed yet
# remove [cla-signed] label if actor has not signed yet
- name: Remove label
uses: actions/github-script@v6
uses: actions-ecosystem/action-remove-labels@2ce5d41b4b6aa8503e285553f75ed56e0a40bae0
if: steps.contributors.outputs.hasSigned == 'false' && steps.pr.outputs.hasLabel == 'true'
with:
github-token: ${{ inputs.token }}
script: |
await github.rest.issues.removeLabel({
...context.repo,
issue_number: context.issue.number,
name: '${{ inputs.label }}'
})
github_token: ${{ inputs.token }}
labels: ${{ inputs.label }}

# create sticky comment if not signed
- name: Create comment
Expand Down