Skip to content

Commit

Permalink
Merge pull request #190 from laminas/feature/hosts-validator-workflow
Browse files Browse the repository at this point in the history
Hotfix for IANA TLD List Updater workflow
  • Loading branch information
Ocramius authored Jun 1, 2023
2 parents b7b848e + d1d0e53 commit d0dcd55
Showing 1 changed file with 17 additions and 4 deletions.
21 changes: 17 additions & 4 deletions .github/workflows/iana-hostname-list-updater.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,9 @@ jobs:
id: default-branch
shell: bash
run: |
echo "branch-name=$(gh repo view --json defaultBranchRef --jq '.defaultBranchRef.name')" >> $GITHUB_OUTPUT
set -e
echo "branch-name=$(gh repo view "$GITHUB_REPOSITORY" --json defaultBranchRef --jq '.defaultBranchRef.name')" >> $GITHUB_OUTPUT
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Checkout
Expand Down Expand Up @@ -42,9 +44,19 @@ jobs:
run: |
set -e
echo "$SIGNING_SECRET_KEY" > gpg -q --import
SIGNING_KEY_ID=$(echo "$SIGNING_SECRET_KEY" | gpg --import -q --import-options import-show --with-colons | awk -F: '$1=="sec" {print $5; exit}')
if [ -z "$SIGNING_KEY_ID" ]
then
echo "GPG signing key not found in SIGNING_SECRET_KEY"
exit 1
fi
echo "Using gpg key $SIGNING_KEY_ID"
git config --local user.email "$GIT_AUTHOR_EMAIL"
git config --local user.name "$GIT_AUTHOR_NAME"
git config --local user.signingkey "$SIGNING_KEY_ID"
git config --local commit.gpgsign true
env:
GIT_AUTHOR_EMAIL: ${{ secrets.GIT_AUTHOR_EMAIL }}
GIT_AUTHOR_NAME: ${{ secrets.GIT_AUTHOR_NAME }}
Expand All @@ -61,15 +73,16 @@ jobs:
git push --force origin "${USE_BRANCH_NAME}"
PR_STATE=$(gh pr view --json state --jq ".state" "${USE_BRANCH_NAME}" 2>/dev/null || echo "NONE")
PR_STATE=$(gh pr view --repo "$GITHUB_REPOSITORY" --json state --jq ".state" "${USE_BRANCH_NAME}" 2>/dev/null || echo "NONE")
if [[ "$PR_STATE" == "OPEN" ]]
then
echo "PR for branch ${USE_BRANCH_NAME} already opened. Nothing left to do."
exit 0
fi
gh pr create --title "Update IANA TLDs for Hostname validator" \
gh pr create --repo "$GITHUB_REPOSITORY" \
--title "Update IANA TLDs for Hostname validator" \
--body "Automated update of TLDs from IANA list available at https://data.iana.org/TLD/tlds-alpha-by-domain.txt" \
--label "Enhancement"
env:
Expand Down

0 comments on commit d0dcd55

Please sign in to comment.