Skip to content

Commit

Permalink
try again
Browse files Browse the repository at this point in the history
  • Loading branch information
micsza committed Nov 21, 2023
1 parent d6c93e5 commit 1bd9e47
Showing 1 changed file with 45 additions and 45 deletions.
90 changes: 45 additions & 45 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,51 +12,51 @@ jobs:
- uses: srvaroa/labeler@master
env:
GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
output:
runs-on: ubuntu-latest
steps:
- id: sets-a-secret
name: Generate, mask, and output a secret
run: |
the_secret=$((RANDOM))
echo "::add-mask::$the_secret"
echo "secret-number=$the_secret" >> "$GITHUB_OUTPUT"
- name: Use that secret output (protected by a mask)
run: |
echo "the secret number is ${{ steps.sets-a-secret.outputs.secret-number }}"
auto-merge:
name: Auto merge
runs-on: ubuntu-20.04
steps:
- name: View PR author
run: echo "This PR is opened by ${{ github.event.pull_request.user.login }} ."
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Get changes
run: git diff --name-only ${{ github.event.before }} ${{ github.event.after }}

auto-merge-2:
name: Auto merge 2
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v3
with:
fetch-depth: ${{ github.event_name == 'pull_request' && 2 || 0 }}
- name: Get changed files
id: changed-files
run: |
if ${{ github.event_name == 'pull_request' }}; then
echo "changed_files=$(git diff --name-only -r HEAD^1 HEAD | xargs)" >> $GITHUB_OUTPUT
else
echo "changed_files=$(git diff --name-only ${{ github.event.before }} ${{ github.event.after }} | xargs)" >> $GITHUB_OUTPUT
fi
- name: List changed files
run: |
for file in ${{ steps.changed-files.outputs.changed_files }}; do
echo "$file was changed"
done
# output:
# runs-on: ubuntu-latest
# steps:
# - id: sets-a-secret
# name: Generate, mask, and output a secret
# run: |
# the_secret=$((RANDOM))
# echo "::add-mask::$the_secret"
# echo "secret-number=$the_secret" >> "$GITHUB_OUTPUT"
# - name: Use that secret output (protected by a mask)
# run: |
# echo "the secret number is ${{ steps.sets-a-secret.outputs.secret-number }}"
# auto-merge:
# name: Auto merge
# runs-on: ubuntu-20.04
# steps:
# - name: View PR author
# run: echo "This PR is opened by ${{ github.event.pull_request.user.login }} ."
# - name: Checkout
# uses: actions/checkout@v3
# with:
# fetch-depth: 0
# - name: Get changes
# run: git diff --name-only ${{ github.event.before }} ${{ github.event.after }}
#
# auto-merge-2:
# name: Auto merge 2
# runs-on: ubuntu-20.04
# steps:
# - uses: actions/checkout@v3
# with:
# fetch-depth: ${{ github.event_name == 'pull_request' && 2 || 0 }}
# - name: Get changed files
# id: changed-files
# run: |
# if ${{ github.event_name == 'pull_request' }}; then
# echo "changed_files=$(git diff --name-only -r HEAD^1 HEAD | xargs)" >> $GITHUB_OUTPUT
# else
# echo "changed_files=$(git diff --name-only ${{ github.event.before }} ${{ github.event.after }} | xargs)" >> $GITHUB_OUTPUT
# fi
# - name: List changed files
# run: |
# for file in ${{ steps.changed-files.outputs.changed_files }}; do
# echo "$file was changed"
# done

ci:
# run on external PRs, but not on internal PRs since those will be run by push to branch
Expand Down

0 comments on commit 1bd9e47

Please sign in to comment.