-
Notifications
You must be signed in to change notification settings - Fork 1
feat: Create release on push #3
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
Merged
Merged
Changes from all commits
Commits
Show all changes
14 commits
Select commit
Hold shift + click to select a range
f003df5
feat: create release on push
sator-imaging b052002
Add test.txt with initial test content
sator-imaging 76373f6
add link to release body
sator-imaging a24be69
Create ddd.txt
sator-imaging c6e0bdb
Create test2.txt
sator-imaging e87c879
fix
sator-imaging f534c5f
Create test3.txt
sator-imaging eb9c020
fix 2
sator-imaging 9a55ffb
Create test.md
sator-imaging b4d031d
Create test.md
sator-imaging d614f3b
cleanup
sator-imaging c162260
Update .github/workflows/create-release.yml
prozolic 2a90fd9
Update .github/workflows/create-release.yml
prozolic a9df40a
Update .github/workflows/create-release.yml
prozolic File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,52 @@ | ||
| name: Create Release from archives | ||
|
|
||
| on: | ||
| push: | ||
| branches: | ||
| - main | ||
| paths: | ||
| - 'archives/**/*.md' | ||
|
|
||
| permissions: | ||
| contents: write | ||
|
|
||
| jobs: | ||
| create-release: | ||
| runs-on: ubuntu-latest | ||
| timeout-minutes: 10 | ||
|
|
||
| steps: | ||
| - uses: actions/checkout@1af3b93b6815bc44a9784bd300feb67ff0d1eeb3 # v6.0.0 | ||
| with: | ||
| fetch-depth: 2 # For git diff | ||
|
|
||
| - name: Generate tag name | ||
| id: tag | ||
| run: | | ||
| TAG_NAME="archives-$(date +'%Y%m%d')-${GITHUB_SHA::7}" | ||
| echo "tag_name=$TAG_NAME" >> $GITHUB_OUTPUT | ||
|
|
||
| - name: Detect changed archive file | ||
| id: archive | ||
| run: | | ||
| echo "Changed files:" | ||
| git diff-tree --no-commit-id --name-only -r HEAD | ||
|
|
||
| FILE=$(git diff-tree --no-commit-id --name-only -r HEAD | grep "^archives/.*\.md$" | head -n 1) | ||
|
|
||
| if [ -z "$FILE" ]; then | ||
| echo "Error: No archives changes detected" | ||
| exit 1 | ||
| fi | ||
|
|
||
| echo "file=$FILE" >> $GITHUB_OUTPUT | ||
|
|
||
| - name: Create Release (with archive URL) | ||
| env: | ||
| GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
| run: | | ||
| FILE_URL="https://github.com/${{ github.repository }}/blob/main/${{ steps.archive.outputs.file }}" | ||
|
|
||
| gh release create "${{ steps.tag.outputs.tag_name }}" \ | ||
| --title "Release ${{ steps.tag.outputs.tag_name }}" \ | ||
| --notes "📄 $FILE_URL" | ||
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.