Skip to content

fix github actions#4

Merged
PranjaliSachan merged 1 commit into
mainfrom
1-release-accordion-hero-widget
Jan 8, 2026
Merged

fix github actions#4
PranjaliSachan merged 1 commit into
mainfrom
1-release-accordion-hero-widget

Conversation

@PranjaliSachan

Copy link
Copy Markdown
Owner

No description provided.

@PranjaliSachan PranjaliSachan self-assigned this Jan 8, 2026
Copilot AI review requested due to automatic review settings January 8, 2026 02:29
@PranjaliSachan PranjaliSachan added the bug Something isn't working label Jan 8, 2026
@PranjaliSachan PranjaliSachan merged commit 373810f into main Jan 8, 2026
5 checks passed

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR attempts to fix GitHub Actions by enabling the workflow to commit build artifacts (ZIP files) back to the repository. The changes include adding permissions for the workflow to write to the repository, configuring git to push commits, and removing ZIP files from .gitignore so they can be tracked.

Key changes:

  • Added contents: write permission to the GitHub Actions workflow
  • Implemented automatic commit and push of built ZIP files to the main branch
  • Removed releases/*.zip from .gitignore to allow tracking of build artifacts

Reviewed changes

Copilot reviewed 1 out of 3 changed files in this pull request and generated 2 comments.

File Description
.github/workflows/build-and-release.yml Added permissions and a new step to commit and push ZIP files back to the main branch after builds
.gitignore Removed exclusion for releases/*.zip to allow committing build artifacts
releases/accordion-hero-slider-v1.1.0.zip Added binary build artifact to the repository

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +40 to +48
- name: Commit and Push ZIP (Main Branch only)
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
run: |
git config --local user.email "action@github.com"
git config --local user.name "GitHub Action"
git add releases/*.zip
git commit -m "chore: build version v${{ env.VERSION }} [skip ci]" || echo "No changes to commit"
git push origin main

Copilot AI Jan 8, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The commit step will create an infinite loop because while it includes "[skip ci]" in the commit message, the workflow is triggered on pushes to main. Even with "[skip ci]", some CI systems may still trigger. Additionally, this creates a race condition if multiple PRs are merged simultaneously - each will try to push to main which could cause conflicts.

Consider using a bot account with specific permissions or restructure the workflow to avoid committing back to the repository during the build process. A better approach would be to only commit the ZIP file during tagged releases or use GitHub Releases to store artifacts without committing them to the repository.

Suggested change
- name: Commit and Push ZIP (Main Branch only)
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
run: |
git config --local user.email "action@github.com"
git config --local user.name "GitHub Action"
git add releases/*.zip
git commit -m "chore: build version v${{ env.VERSION }} [skip ci]" || echo "No changes to commit"
git push origin main

Copilot uses AI. Check for mistakes.
- name: Commit and Push ZIP (Main Branch only)
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
run: |
git config --local user.email "action@github.com"

Copilot AI Jan 8, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Using "action@github.com" as the commit email is not following GitHub's recommended practice. GitHub recommends using the noreply email format for GitHub Actions: "{github_actor_id}+{github_actor}@users.noreply.github.com" or "github-actions[bot]@users.noreply.github.com". This ensures proper attribution in the commit history.

Suggested change
git config --local user.email "action@github.com"
git config --local user.email "github-actions[bot]@users.noreply.github.com"

Copilot uses AI. Check for mistakes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants