Skip to content

Commit 2422b6b

Browse files
authored
Merge pull request #1 from GeekMasher/ft/auto-updates
Automatic Updates
2 parents 5c07bdc + 07cc809 commit 2422b6b

File tree

2 files changed

+56
-5
lines changed

2 files changed

+56
-5
lines changed

.github/workflows/check.yml

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
name: Check Versions
2+
3+
on:
4+
schedule:
5+
- cron: '0 * * * *'
6+
7+
env:
8+
DESTINATION_REPOSITORY: github/codeql-action
9+
SOURCE_REPOSITORY: ${{ github.repository }}
10+
11+
jobs:
12+
check:
13+
runs-on: ubuntu-latest
14+
steps:
15+
- name: Checkout repository
16+
uses: actions/checkout@v2
17+
18+
- name: Compare The Latest Releases Between Two Repositories
19+
id: compare-releases
20+
uses: NickLiffen/compare-releases@v2.0.4
21+
with:
22+
destinationRepository: ${{ env.DESTINATION_REPOSITORY }}
23+
sourceRepository: ${{ env.SOURCE_REPOSITORY }}
24+
token: ${{ secrets.GH_TOKEN }}
25+
26+
- name: Get results
27+
run: |
28+
echo "The result is ${{ steps.compare-releases.outputs.repo }}"
29+
echo "The result is ${{ steps.compare-releases.outputs.tagName }}"
30+
31+
- name: Invoke Release Workflow
32+
if: ${{ steps.compare-releases.outputs.repo == env.DESTINATION_REPOSITORY }}
33+
uses: benc-uk/workflow-dispatch@v1
34+
with:
35+
workflow: release
36+
token: ${{ secrets.GH_TOKEN }}
37+
inputs: '{ "tagName": "${{ steps.compare-releases.outputs.tagName }}" }'
38+

.github/workflows/release.yml

Lines changed: 18 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
1-
name: Create and publish a Docker image
1+
name: release
22

33
on:
4-
push:
5-
branches: ['main']
6-
release:
7-
types: [published]
4+
workflow_dispatch:
5+
inputs:
6+
tagName:
7+
description: 'Name to tag this release'
8+
required: true
89

910
env:
1011
REGISTRY: ghcr.io
@@ -41,3 +42,15 @@ jobs:
4142
push: true
4243
tags: ${{ steps.meta.outputs.tags }}
4344
labels: ${{ steps.meta.outputs.labels }}
45+
46+
- name: Get result
47+
run: |
48+
echo "The result is ${{ github.event.inputs.tagName }}"
49+
50+
- name: Publish Release
51+
uses: "marvinpinto/action-automatic-releases@latest"
52+
with:
53+
repo_token: "${{ secrets.GH_TOKEN }}"
54+
automatic_release_tag: "${{ github.event.inputs.tagName }}"
55+
prerelease: false
56+
title: "${{ github.event.inputs.tagName }}"

0 commit comments

Comments
 (0)