Skip to content

Commit

Permalink
fix(actions): create diff action in github workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
luchosr committed Dec 31, 2024
1 parent f4e8d25 commit 6636f5e
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 21 deletions.
29 changes: 29 additions & 0 deletions .github/workflows/diff.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
on:
pull_request:
# branches: [ "main" ]
# Here the action will get the PR number
- name: Get Pull Request Number
id: pr
run: echo "::set-output name=pull_request_number::$(gh pr view --json number -q .number || echo "")"
env:
PR_NUMBER: ${{ github.event.number }}
# Here the action will get the diff
- name: Get Pull Request Diffing Files
id: diff
run: gh pr diff --name-only
# run: gh pr diff PR_NUMBER

# Can I get the diff in an environment variable?

# jobs:
# uses: actions/checkout@v4
# checkout code from repo
# run cargo run ${{ github.actor }}
# The name of your branch is ${{ github.ref }}

jobs:
success:
runs-on: ubuntu-latest
steps:
- name: Checkout Source
uses: actions/checkout@v4
21 changes: 0 additions & 21 deletions action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,24 +11,6 @@ inputs:
description: GitHub Token Used to interact with the GitHub API
default: ${{ github.token }}

on:
pull_request:
branches: [ "main" ]
# Here the action will get the PR number
- name: Get Pull Request Number
id: pr
run: echo "::set-output name=pull_request_number::$(gh pr view --json number -q .number || echo "")"
env:
PR_NUMBER: ${{ github.event.number }}
# Here the action will get the diff
- name: Get Pull Request Diffing Files
id: diff
run: gh pr diff --name-only

# Can I get the diff in an environment variable?



runs:
using: composite
steps:
Expand All @@ -47,6 +29,3 @@ runs:
run: |
chmod +x ./rustacean-authorship-action-ubuntu-latest
./rustacean-authorship-action-ubuntu-latest "${{ inputs.pr_author }}"

0 comments on commit 6636f5e

Please sign in to comment.