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

Simplify the implementation #105

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
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
11 changes: 2 additions & 9 deletions .github/workflows/inception.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,6 @@ jobs:
issuesOpened:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
cache: npm
node-version: 20
- run: npm ci
- run: npm run build
- uses: ./
- uses: probot/example-github-action@v2
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
4 changes: 1 addition & 3 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,12 @@ jobs:
node-version: 20
cache: npm
- run: npm ci
- run: npm run build
- run: rm .gitignore
- run: npx semantic-release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- run: >-
git push
https://x-access-token:${GITHUB_TOKEN}@github.com/${GITHUB_REPOSITORY}.git
HEAD:refs/heads/v1
HEAD:refs/heads/v2
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ jobs:
sayHelloWorld:
runs-on: ubuntu-latest
steps:
- uses: probot/example-github-action@v1
- uses: probot/example-github-action@v2
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
```
Expand All @@ -31,7 +31,7 @@ See the action in ... action [#1](https://github.com/probot/example-github-actio
Alternatively, you can pass the token with `with:`

```yml
- uses: probot/example-github-action@v1
- uses: probot/example-github-action@v2
with:
token: ${{ secrets.GITHUB_TOKEN }}
# or
Expand All @@ -57,7 +57,7 @@ This repository is continuously publishing new versions to the special `v1` bran
1. `"build": "ncc build index.js -o dist"` script - bundle the app into `dist/index.js`
2. `"release"` - configure publishing from the `"main"` branch, and configure the `git` plugin to add a commit after publishing

The other relevant bit is [`.github/workflows/release.yml`](.github/workflows/release.yml), which is run on each push to the default branch (`main`). It installs all dependencies, runs the `build` script, runs semantic-release which creates the GitHub release based on semantic commit message conventions (`fix: ...`, `feat: ...`) and commits the `dist/index.js` file. Then it pushes the changes to the `v1` branch, so that users will always get the latest version when referencing `probot/exmaple-github-action@v1`. If there should ever be a breaking change, we would change the publish branch to `v2`, etc.
The other relevant bit is [`.github/workflows/release.yml`](.github/workflows/release.yml), which is run on each push to the default branch (`main`). It installs all dependenciesand runs semantic-release which creates the GitHub release based on semantic commit message conventions (`fix: ...`, `feat: ...`). Then it pushes the changes to the `v2` branch, so that users will always get the latest version when referencing `probot/exmaple-github-action@v2`. If there should ever be a breaking change, we would change the publish branch to `v3`, etc.

## License

Expand Down
2 changes: 1 addition & 1 deletion action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@ branding:
color: orange
runs:
using: "node20"
main: "dist/index.js"
main: "index.js"
Copy link
Contributor

Choose a reason for hiding this comment

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

are you sure this is working? Others won't be able to use the action, the whole code must be bundled for it to work

Loading