Skip to content

Commit

Permalink
Merge branch 'body-file' into main
Browse files Browse the repository at this point in the history
  • Loading branch information
peter-evans committed Oct 24, 2022
2 parents acea7ce + 666805d commit 029195c
Show file tree
Hide file tree
Showing 8 changed files with 2,150 additions and 988 deletions.
1 change: 1 addition & 0 deletions .github/FUNDING.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
github: peter-evans
7 changes: 7 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,10 @@ updates:
interval: "weekly"
labels:
- "dependencies"

- package-ecosystem: "npm"
directory: "/"
schedule:
interval: "weekly"
allow:
- dependency-name: "@actions/*"
5 changes: 5 additions & 0 deletions .github/multiline-content.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
This is a multi-line test comment read from a file.
- With GitHub **Markdown** :sparkles:
- Created by [create-or-update-comment][1]

[1]: https://github.com/peter-evans/create-or-update-comment
10 changes: 8 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,12 @@ on:
paths-ignore:
- 'README.md'
- 'docs/**'

permissions:
issues: write
pull-requests: write
contents: write

jobs:
build:
runs-on: ubuntu-latest
Expand All @@ -34,9 +40,9 @@ jobs:
- id: vars
run: |
if [[ "${{ github.event_name }}" == "pull_request" ]]; then \
echo "::set-output name=issue-number::${{ github.event.number }}"; \
echo "issue-number=${{ github.event.number }}" >> $GITHUB_OUTPUT; \
else \
echo "::set-output name=issue-number::1"; \
echo "issue-number=1" >> $GITHUB_OUTPUT; \
fi
test:
Expand Down
24 changes: 20 additions & 4 deletions .github/workflows/test-command.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,13 @@ jobs:
run: |
repository=${{ github.event.client_payload.slash_command.repository }}
if [[ -z "$repository" ]]; then repository=${{ github.repository }}; fi
echo ::set-output name=repository::$repository
echo "repository=$repository" >> $GITHUB_OUTPUT
branch=${{ github.event.client_payload.slash_command.branch }}
if [[ -z "$branch" ]]; then branch="main"; fi
echo ::set-output name=branch::$branch
echo "branch=$branch" >> $GITHUB_OUTPUT
# Checkout the branch to test
- uses: actions/checkout@v2
- uses: actions/checkout@v3
with:
repository: ${{ steps.vars.outputs.repository }}
ref: ${{ steps.vars.outputs.branch }}
Expand Down Expand Up @@ -60,9 +60,25 @@ jobs:
comment-id: ${{ github.event.client_payload.github.payload.comment.id }}
reactions: hooray

# Test create with body from file
- id: get-comment-body
run: |
body="$(cat .github/multiline-content.md)"
delimiter="$(openssl rand -hex 8)"
echo "body<<$delimiter" >> $GITHUB_OUTPUT
echo "$body" >> $GITHUB_OUTPUT
echo "$delimiter" >> $GITHUB_OUTPUT
- name: Create comment
uses: ./
with:
issue-number: 1
body: ${{ steps.get-comment-body.outputs.body }}

# Test create from template
- name: Render template
id: template
uses: chuhlomin/render-template@v1.4
uses: chuhlomin/render-template@v1.6
with:
template: .github/comment-template.md
vars: |
Expand Down

0 comments on commit 029195c

Please sign in to comment.