-
Notifications
You must be signed in to change notification settings - Fork 38
53 lines (47 loc) · 1.54 KB
/
validate-new-contributor.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
name: Validate New Contributor
on:
pull_request:
types: [opened, edited]
branches:
- main
paths:
- 'CONTRIBUTING.md'
workflow_call:
inputs:
pull-request-number:
required: true
type: string # NOTE: github has a bug with 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@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 .