Skip to content

Commit

Permalink
update ci 31
Browse files Browse the repository at this point in the history
  • Loading branch information
hirsch88 committed Feb 28, 2024
1 parent b807211 commit 77b1dd6
Showing 1 changed file with 41 additions and 0 deletions.
41 changes: 41 additions & 0 deletions .github/workflows/create-base.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
name: 📸 Create Base Image by File

on:
issue_comment:
types: [created]

jobs:
CreateSnapshot:
if: github.event.issue.pull_request && contains(github.event.comment.body, '/create-base-image')
runs-on: ubuntu-latest
timeout-minutes: 15
steps:
- name: Get Action URL
id: action-url
run: echo "url=https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}" >> $GITHUB_OUTPUT

- name: Check for /create-base-image command
uses: actions/github-script@v5
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
script: |
const comment = context.payload.comment.body.trim();
const regex = /\/create-base-image(?:\s+(.*))?/;
if (regex.test(comment)) {
const match = comment.match(regex);
const imageName = match[1] ? match[1].trim() : '';
console.log(`Detected /create-base-image command with argument: ${imageName}`);
// Set the output variable
process.env['GITHUB_OUTPUT'] = imageName;
}
# - name: Create comment
# uses: peter-evans/create-or-update-comment@v4
# with:
# comment-id: ${{ github.event.comment.id }}
# edit-mode: replace
# body: |
# **📸 Create Base Image in Progress...**

# [Check out the release on GitHub ↗︎](${{ steps.action-url.outputs.url }})

0 comments on commit 77b1dd6

Please sign in to comment.