Skip to content

Nowa klasa Main

Nowa klasa Main #2

Workflow file for this run

name: hacktoberfest-labeler
on:
pull_request_target:
types: [opened, reopened, closed]
permissions:
contents: read
pull-requests: write
jobs:
auto-labeler:
runs-on: ubuntu-latest
steps:
- name: Check for hacktoberfest season
id: check-month
run: |
current_month=$(date +'%m')
if [ "$current_month" == "10" ]; then
echo "is_october=true" >> $GITHUB_OUTPUT
else
echo "is_october=false" >> $GITHUB_OUTPUT
fi
- name: Creating config file
env:
ACTION: ${{ github.event.action }}
MERGED: ${{ github.event.pull_request.merged }}
run: |
touch ./hacktoberfest-labeler.yml
echo "ACTION Value = $ACTION\n\n"
echo "MERGED Value = $MERGED\n\n"
if [ "$ACTION" == "opened" ]; then
echo "hacktoberfest:" > hacktoberfest-labeler.yml
elif [ "$MERGED" == "true" ]; then
echo "hacktoberfest-accepted:" > hacktoberfest-labeler.yml
else
echo "invalid:" > hacktoberfest-labeler.yml
fi
echo "- changed-files:" >> hacktoberfest-labeler.yml
echo " - any-glob-to-any-file: '**'" >> hacktoberfest-labeler.yml
echo "Created the config file:"
echo "------------------------"
cat ./hacktoberfest-labeler.yml
- name: Label the PRs
if: steps.check-month.outputs.is_october == 'true' ||
github.event.pull_request.merged == 'true' &&
contains(github.event.pull_request.labels.*.name, 'hacktoberfest')
uses: actions/[email protected]
with:
configuration-path: ./hacktoberfest-labeler.yml