Skip to content

Commit

Permalink
build: update to support BETA releases
Browse files Browse the repository at this point in the history
https://github.com/orgs/AlaskaAirlines/discussions/556

This code diff represents changes made to multiple files in a Git repository.
It includes modifications to the `.github/settings.yml` file, the
`.github/workflows/testPublish.yml` file, and the `package.json` file.

In the `.github/settings.yml` file, the changes include:
- Enabling the requirement for code owner reviews before merging pull requests.
- Adding dismissal restrictions for pull request reviews, allowing only
the user "blackfalcon" to dismiss reviews.
- Enabling the prevention of merge commits on matching branches.

In the `.github/workflows/testPublish.yml` file, the change includes:
- Modifying the condition for triggering the release job. It will now trigger
on push events to either the `master` branch or the `beta` branch.

In the `package.json` file, the change includes:
- Modifying the `release` configuration to include both the `master` and `beta`
branches for semantic release. The `beta` branch is marked as a prerelease branch.

Changes to be committed:
modified:   .github/settings.yml
modified:   .github/workflows/testPublish.yml
modified:   package.json
  • Loading branch information
blackfalcon committed Jun 18, 2024
1 parent c369897 commit 149fcd6
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 6 deletions.
13 changes: 11 additions & 2 deletions .github/settings.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ repository:
allow_rebase_merge: true

branches:
- name: master
- &default_protection
# https://developer.github.com/v3/repos/branches/#update-branch-protection
# Branch Protection settings. Set to null to disable
protection:
Expand All @@ -50,7 +50,8 @@ branches:
# Dismiss approved reviews automatically when a new commit is pushed.
dismiss_stale_reviews: true
# Blocks merge until code owners have reviewed.
require_code_owner_reviews: false
require_code_owner_reviews: true
# Required. Require status checks to pass before merging. Set to null to disable
# Specify which users and teams can dismiss pull request reviews. Pass an empty dismissal_restrictions object to disable. User and team dismissal_restrictions are only available for organization-owned repositories. Omit this parameter for personal repositories.
dismissal_restrictions:
users: ["blackfalcon"]
Expand All @@ -64,6 +65,14 @@ branches:
enforce_admins: false
# Required. Restrict who can push to this branch. Team and user restrictions are only available for organization-owned repositories. Set to null to disable.
restrictions: null
# Prevent merge commits from being pushed to matching branches
required_linear_history: true

- name: master
<<: *default_protection

- name: beta
<<: *default_protection

# Labels: define labels for Issues and Pull Requests
labels:
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/testPublish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ name: Test and publish
# events but only for the master branch
on:
push:
branches: [ master ]
branches: [ master, beta ]
pull_request:
branches: [ master ]
branches: [ master, beta ]

# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
Expand All @@ -30,7 +30,7 @@ jobs:

release:
# Only release on push to master
if: github.event_name == 'push' && github.ref == 'refs/heads/master'
if: github.event_name == 'push' && github.ref == 'refs/heads/master' || 'refs/heads/beta'
runs-on: ubuntu-latest
needs: test
steps:
Expand Down
10 changes: 9 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,15 @@
"prepare": "husky install && chmod ug+x .husky/* && chmod ug+x .git/hooks/*"
},
"release": {
"branch": "master",
"branches": [
{
"name": "master"
},
{
"name": "beta",
"prerelease": true
}
],
"plugins": [
"@semantic-release/commit-analyzer",
"@semantic-release/release-notes-generator",
Expand Down

0 comments on commit 149fcd6

Please sign in to comment.