GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — AliceO2/.github/workflows/code-transformations.yml at dev · ehellbar/AliceO2

Expand file tree

/

code-transformations.yml

Copy path
View runs
More file actions
More file actions

Latest commit

 

History

History
History
84 lines (74 loc) · 4.05 KB
/

code-transformations.yml

Copy path

File metadata and controls

84 lines (74 loc) · 4.05 KB
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
name: Current refactorings
on: [pull_request_target]
env:
RATIONALE: "Adapt to new FairLogger API"
REFACTORING: "s|LOGP[(]ERROR|LOGP(error|g;s|LOGP[(]INFO|LOGP(info|g;s|LOGP[(]WARNING|LOGP(warning|g;s|LOGP[(]WARN|LOGP(warn|g;s|LOGP[(]DEBUG|LOGP(debug|;s|LOG[(]ERROR|LOG(error|g;s|LOG[(]INFO|LOG(info|g;s|LOG[(]WARNING|LOG(warning|g;s|LOG[(]WARN|LOG(warn|g;s|LOG[(]DEBUG|LOG(debug|g"
jobs:
build:
# We need at least 20.04 to install clang-format-11.
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
ref: ${{ github.event.pull_request.head.sha }}
persist-credentials: false
# We need the history of the dev branch all the way back to where the PR
# diverged. We're fetching everything here, as we don't know how many
# commits back that point is.
fetch-depth: 0
- name: Run refactoring
id: run_refactoring
env:
ALIBUILD_GITHUB_TOKEN: ${{secrets.ALIBUILD_GITHUB_TOKEN}}
run: |
set -x
# We need to fetch the other commit.
git fetch origin ${{ github.event.pull_request.base.ref }} \
pull/${{ github.event.pull_request.number }}/head:${{ github.event.pull_request.head.ref }}
# We create a new branch which we will use for the eventual PR.
git config --global user.email "[email protected]"
git config --global user.name "ALICE Action Bot"
git checkout -b alibot-refactor-${{ github.event.pull_request.number }} ${{ github.event.pull_request.head.sha }}
# github.event.pull_request.base.sha is the latest commit on the branch
# the PR will be merged into, NOT the commit this PR derives from! For
# that, we need to find the latest common ancestor between the PR and
# the branch we are merging into.
BASE_COMMIT=$(git merge-base HEAD ${{ github.event.pull_request.base.sha }})
echo "Running refactoring against branch ${{ github.event.pull_request.base.ref }}, with hash ${{ github.event.pull_request.base.sha }}"
COMMIT_FILES=$(git diff --diff-filter d --name-only $BASE_COMMIT)
if [ -z "$COMMIT_FILES" ]; then
echo "No files to check" >&2
echo clean=true >> "$GITHUB_OUTPUT"
exit 0
fi
perl -p -i -e "${{ env.REFACTORING }}" $COMMIT_FILES
if git diff --exit-code; then
echo "Refactoring not needed."
git push --set-upstream https://alibuild:[email protected]/alibuild/AliceO2.git :alibot-refactoring-${{ github.event.pull_request.number }} -f || true
echo clean=true >> "$GITHUB_OUTPUT"
else
git commit -m "${{ env.RATIONALE }}" -a
git show | cat
git fetch https://github.com/AliceO2Group/AliceO2.git pull/${{ github.event.pull_request.number }}/head
git push --set-upstream https://alibuild:[email protected]/alibuild/AliceO2.git HEAD:refs/heads/alibot-refactoring-${{ github.event.pull_request.number }} -f
echo clean=false >> "$GITHUB_OUTPUT"
fi
- name: pull-request
uses: alisw/pull-request@master
with:
source_branch: 'alibuild:alibot-refactoring-${{ github.event.pull_request.number }}'
destination_branch: '${{ github.event.pull_request.head.label }}'
github_token: ${{ secrets.ALIBUILD_GITHUB_TOKEN }}
pr_title: "Please consider the refactoring changes to AliceO2Group/AliceO2#${{ github.event.pull_request.number }}"
pr_body: |
AliceO2Group/AliceO2#${{ github.event.pull_request.number }}" cannot be merged as is.
You should either modify your code according to what is done in this PR, or directly merge this PR in yours.
The rationale for this change is:
${{ env.RATIONALE }}
continue-on-error: true # We do not create PRs if the branch is not there.
- name: Exit with error if the PR is not clean
run: |
case ${{ steps.run_refactoring.outputs.clean }} in
true) echo "PR clean" ; exit 0 ;;
false) echo "PR not clean" ; exit 1 ;;
esac
You are visitor 01402520 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.