Skip to content

Update allowlist-request.yml #1

Update allowlist-request.yml

Update allowlist-request.yml #1

name: Add Domain to Allowlist and Compile
on:
push:
schedule:
- cron: '0 2 * * *' # Runs every day at 2:00 AM
jobs:
add_domain_and_compile_allowlist:
name: Add Domain to Allowlist and Compile
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@main
- name: Check if issue has label 'allowlist-request'
id: check_label
run: |
if [[ $(jq -r '.issue.labels[].name' $GITHUB_EVENT_PATH) == *"allowlist-request"* ]]; then
echo "Label 'allowlist-request' found."
exit 0
else
echo "Label 'allowlist-request' not found. Exiting..."
exit 1
fi
- name: Debug issue comment
if: steps.check_label.outputs.code == '0'
run: echo "Issue Comment Body: ${{ github.event.comment.body }}"

Check failure on line 30 in .github/workflows/allowlist-request.yml

View workflow run for this annotation

GitHub Actions / .github/workflows/allowlist-request.yml

Invalid workflow file

You have an error in your yaml syntax on line 30
- name: Extract domain from issue comment
id: extract_domain
if: steps.check_label.outputs.code == '0'
run: |
# Extract domain from the issue comment
# Assuming the comment has a textarea input field with id 'domains'
domain=$(echo "${{ github.event.comment.body }}" | grep -oP '(?<=id: domains\n)[^\n]+')
echo "::set-output name=domain::$domain"
- name: Debug extracted domain
if: steps.check_label.outputs.code == '0'
run: echo "Extracted Domain: ${{ steps.extract_domain.outputs.domain }}"
- name: Append domain to allowlist
if: steps.check_label.outputs.code == '0'
run: echo "${{ steps.extract_domain.outputs.domain }}" >> allowlist-request.txt
- name: Start commit change
if: steps.check_label.outputs.code == '0'
run: echo "MSG=Update allowlist with domain at $(date +'%Y%m%d')" >> $GITHUB_ENV
- name: Commit changes
if: steps.check_label.outputs.code == '0'
run: |
git config --global user.email "actions@github.com"
git config --global user.name "GitHub Actions"
git add .
git commit -m "${{ env.MSG }}"
- name: Push changes to dev branch
if: steps.check_label.outputs.code == '0'
run: |
git push origin HEAD:dev