bump version to 1.5.1 and add import field in package.json (#140) #21
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Workflow name - shows up in GitHub Actions UI | |
name: Auto PR and Merge - dev 🤗 | |
# Defines when this workflow will run | |
on: | |
push: | |
branches: | |
- dev # Only triggers when pushing to the 'dev' branch | |
# Add this permissions block at the workflow level | |
permissions: | |
contents: write # Needed for checking out code and pushing changes | |
pull-requests: write # Needed for creating and merging PRs | |
jobs: | |
create-and-merge-pr: # Job identifier | |
runs-on: ubuntu-latest # Specifies the runner environment | |
steps: | |
# Step 1: Check out repository | |
- uses: actions/checkout@v4 # Official GitHub checkout action | |
with: | |
ref: main # Checks out the main branch as we'll be creating a PR into it | |
# Step 2: Reset the main branch to match dev branch | |
- name: Reset branch | |
run: | | |
git fetch origin dev:dev # Fetches the dev branch | |
git reset --hard dev # Resets main to match dev branch content | |
- name: Create Pull Request | |
id: cpr # Gives this step an ID so we can reference its outputs later | |
uses: peter-evans/create-pull-request@67ccf781d68cd99b580ae25a5c18a1cc84ffff1f # Uses peter-evans PR creation action | |
with: | |
branch: dev-to-main # Name of the temporary branch for the PR | |
token: ${{ secrets.GITHUB_TOKEN }} # Uses default GitHub token for authentication | |
assignees: gesslar # Adds @gesslar as an assignee | |
reviewers: gesslar # Adds @gesslar as a reviewer | |
# Step 4: Output PR details for logging/debugging | |
- name: Check outputs | |
if: ${{ steps.cpr.outputs.pull-request-number }} # Only runs if a PR was created | |
run: | | |
echo "Pull Request Number - ${{ steps.cpr.outputs.pull-request-number }}" | |
echo "Pull Request URL - ${{ steps.cpr.outputs.pull-request-url }}" | |
# Step 5: Automatically merge the Pull Request | |
- name: Merge Pull Request | |
if: ${{ steps.cpr.outputs.pull-request-number }} # Only runs if a PR was created | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Token for authentication | |
PR_NUMBER: ${{ steps.cpr.outputs.pull-request-number }} # PR number from create step | |
run: | | |
# Merges PR, using --merge for standard merge commit | |
# --auto enables auto-merge if checks are required | |
# --delete-branch removes the temporary branch after merging | |
gh pr merge $PR_NUMBER --merge --auto --delete-branch |