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
46 changes: 46 additions & 0 deletions .github/workflows/check-misp-version.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
name: Check External Release
on:
schedule:
- cron: '0 0 * * 1'
workflow_dispatch:

jobs:
check-release:
runs-on: ubuntu-latest
steps:
Comment thread
Copilot marked this conversation as resolved.
Resolved
- name: Checkout
uses: actions/checkout@v4

- name: Get latest release
id: release
uses: actions/github-script@v7
with:
result-encoding: string
script: |
const { data: release } = await github.rest.repos.getLatestRelease({
owner: 'MISP',
repo: 'MISP'
});
return release.tag_name;

- name: Compare with stored version
id: compare
run: |
LAST_VERSION=$(cat MISP_VERSION 2>/dev/null || echo "")
NEW_VERSION="${{ steps.release.outputs.result }}"
echo "last_version=$LAST_VERSION" >> $GITHUB_OUTPUT
echo "new_version=$NEW_VERSION" >> $GITHUB_OUTPUT
if [ "$LAST_VERSION" != "$NEW_VERSION" ]; then
echo "changed=true" >> $GITHUB_OUTPUT
echo "New MISP release detected: $NEW_VERSION"
echo "$NEW_VERSION" > MISP_VERSION
else
echo "changed=false" >> $GITHUB_OUTPUT
fi

- name: Commit version file
if: steps.compare.outputs.changed == 'true'
uses: stefanzweifel/git-auto-commit-action@v5
with:
commit_message: 'Update MISP version to ${{ steps.compare.outputs.new_version }}'
file_pattern: MISP_VERSION
13 changes: 5 additions & 8 deletions .github/workflows/docker-image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,6 @@ on:
branches: [ main ]
pull_request:
branches: [ main ]
workflow_dispatch:
inputs:
misp_ref:
description: 'MISP branch or tag to build'
required: true
default: 'develop'

env:
REGISTRY_IMAGE: ghcr.io/nukib/misp
Expand All @@ -33,8 +27,11 @@ jobs:
uses: docker/setup-buildx-action@v4

- name: Fetch variables
run: for v in $(python3 .github/workflows/docker-version.py ${{ github.event.inputs.misp_ref }}); do echo $v >> $GITHUB_ENV; done
id: variables
run: |
MISP_VERSION=$(cat MISP_VERSION)
for v in $(python3 .github/workflows/docker-version.py ${MISP_VERSION});
do echo $v >> $GITHUB_ENV;
done

- name: Cache Docker layers
uses: actions/cache@v6
Expand Down
1 change: 1 addition & 0 deletions MISP_VERSION
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
v2.5.50
Loading