Update CONTRIBUTING.md #26
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Validate New Contributor | |
on: | |
pull_request: | |
types: [opened, edited] | |
branches: | |
- new_contributor_validations # TODO: use main | |
paths: | |
- 'CONTRIBUTING.md' | |
workflow_call: | |
inputs: | |
pull-request-number: | |
required: true | |
type: number | |
outputs: | |
email-address: | |
description: "The new contributor's email address." | |
value: ${{ jobs.validate-new-contributor.outputs.email-address }} | |
env: | |
PYTHON_VERSION: 3.11 | |
WORKING_DIR: .github/scripts/python/validate-new-contributor | |
jobs: | |
validate-new-contributor: | |
runs-on: ubuntu-latest | |
outputs: | |
email-address: ${{ steps.validate-new-contributor.outputs.EMAIL_ADDRESS }} | |
steps: | |
- name: ⚙️ Set Pull Request Number | |
run: | | |
if [ "${{ github.event_name }}" == "pull_request" ] | |
then | |
echo "PR_NUM=${{ github.event.pull_request.number }}" >> $GITHUB_ENV | |
else | |
echo "PR_NUM=${{ inputs.pull-request-number }}" >> $GITHUB_ENV | |
fi | |
- name: 🛫 Checkout | |
uses: actions/checkout@v4 | |
with: | |
ref: refs/pull/${{ env.PR_NUM }}/head | |
- uses: ocadotechnology/codeforlife-workspace/.github/actions/python/setup-environment@new_contributor_validations # TODO: use @main | |
with: | |
checkout: 'false' | |
python-version: ${{ env.PYTHON_VERSION }} | |
working-directory: ${{ env.WORKING_DIR }} | |
- name: 🕵️ Validate New Contributor | |
id: validate-new-contributor | |
working-directory: ${{ env.WORKING_DIR }} | |
run: pipenv run python . |