Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix issue with forked branches #193

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 3 additions & 5 deletions .github/workflows/readme-list-update.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name: Update Examples List in README

on:
pull_request:
pull_request_target:
branches:
- main
paths:
Expand All @@ -16,7 +16,8 @@ jobs:
uses: actions/checkout@v4
with:
fetch-depth: 0
ref: ${{ github.head_ref }}
ref: ${{ github.event.pull_request.head.ref }}
repository: ${{ github.event.pull_request.head.repo.full_name }}

- name: Set up Bun
uses: oven-sh/setup-bun@v2
Expand All @@ -31,15 +32,13 @@ jobs:
cat error.log
exit 1
fi

- name: Commit changes
if: success()
run: |
git config --local user.email "[email protected]"
git config --local user.name "GitHub Action"
git add README.md
git commit -m "Update README.md with new examples and technologies" || echo "No changes to commit"

- name: Push changes
if: success()
run: git push origin ${{ github.head_ref }}
Expand All @@ -54,7 +53,6 @@ jobs:
-X POST \
-d '{"body": "🚨 **README Update Failed**\n\nThe following tech stack(s) were found in examples but do not have entries in `techs.json`. Please add each missing tech in `techs.json` with the following format:\n\n```json\n\"tech-id\": \"Tech Display Name\"\n```\n\nFor example:\n\n```json\n\"nextjs\": \"Next.js\"\n```\n\nMissing Tech(s):\n\n```\n'"$tech_error"'\n```"}' \
"https://api.github.com/repos/${{ github.repository }}/issues/${{ github.event.pull_request.number }}/comments")

if [ "$response" -eq 201 ]; then
echo "Comment posted successfully."
else
Expand Down