Skip to content
Merged
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
132 changes: 0 additions & 132 deletions .github/workflows/develop-update.yml

This file was deleted.

23 changes: 23 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,29 @@ jobs:
with:
fetch-depth: 0
persist-credentials: false

- name: "Check if develop is up to date with main"
id: check_diff
if: github.ref == 'refs/heads/develop'
run: |
git fetch origin main
# Check if there are commits in main that aren't in develop
COMMITS=$(git rev-list origin/develop..origin/main --count)
if [ "$COMMITS" -eq 0 ]; then
echo "No commits found in main that aren't in develop. Develop is up to date or ahead."
echo "diff=false" >> $GITHUB_OUTPUT
else
echo "Found $COMMITS commit(s) in main that aren't in develop."
echo "diff=true" >> $GITHUB_OUTPUT
fi

- name: Fail if develop is not up to date with main
if: steps.check_diff.outputs.diff == 'true' && github.ref == 'refs/heads/develop'
run: |
echo "Develop branch is not up to date with main. Please update develop before releasing."
echo "::error title=Develop branch out of date::Develop branch is not up to date with main. Please update develop before releasing."
exit 1

- name: Setup Node.js
uses: actions/setup-node@v6
with:
Expand Down
37 changes: 2 additions & 35 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,8 @@ This workflow contains the release system used throughout CTF Pilot.

The workflow requires the `repository` input to be specified.

When the workflow runs on a push to `develop`, it will fail if `main` is ahead of `develop`.

#### Inputs

- `repository`: Allowed repository for workflow to run in. Example `ctfpilot/hello-world`.
Expand Down Expand Up @@ -166,41 +168,6 @@ jobs:
repository: <repository>
```

### Develop Update

This workflow updates the `develop` branch to match the latest version of the `main` branch.

The workflow requires the `repository` input to be specified.

If no commits are found in `main` that aren't in `develop`, or an existing PR between main and develop exists, the workflow will exit without merging changes, but will create a PR if possible.

#### Inputs

- `repository`: Allowed repository for workflow to run in. Example `ctfpilot/hello-world`.
- `pr_description`: Additional description to add to the PR body.

#### How to use

```yml
name: "Update Develop Branch"

on:
push:
branches:
- main

jobs:
CLAAssistant:
permissions:
contents: read
pull-requests: write
issues: write
name: "Update Develop Branch"
uses: ctfpilot/ci/.github/workflows/develop-update.yml@<version>
with:
repository: <repository>
```

## Contributing

We welcome contributions of all kinds, from **code** and **documentation** to **bug reports** and **feedback**!
Expand Down
Loading