Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 0780a8e

Browse files
authoredFeb 2, 2025··
Merge branch 'main' into style-guide
2 parents 552a318 + e79f548 commit 0780a8e

File tree

83 files changed

+1453
-1423
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

83 files changed

+1453
-1423
lines changed
 

‎.editorconfig

+4-3
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,11 @@ root = true
33
[*]
44
end_of_line = lf
55
insert_final_newline = true
6-
7-
[Makefile]
8-
indent_style = tab
6+
trim_trailing_whitespace = true
97

108
[*.{html,js,json,md,sass,yaml}]
119
indent_style = space
1210
indent_size = 2
11+
12+
[Makefile]
13+
indent_style = tab

‎.github/workflows/check-links.yml

+43-23
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,12 @@ on:
55
merge_group:
66
pull_request:
77

8+
env:
9+
CHANGED_FILES:
10+
PR_NUM: ${{ github.event.pull_request.number }}
11+
USER_EMAIL: 107717825+opentelemetrybot@users.noreply.github.com
12+
USER_NAME: opentelemetrybot
13+
814
jobs:
915
build-and-check-links:
1016
name: BUILD and CHECK LINKS
@@ -43,30 +49,12 @@ jobs:
4349
echo "submodule(s); or undo the submodule update(s) if it happened by mistake."
4450
npm run _diff:fail
4551
46-
- run: npm run log:check:links
52+
- run: |
53+
npm run log:check:links
54+
CHANGED_FILES=$(git status --porcelain)
55+
echo "CHANGED_FILES=$CHANGED_FILES" >> "$GITHUB_ENV"
4756
continue-on-error: true
4857
49-
- name: Push changes if any, and fail check
50-
run: |
51-
if [[ $(git status --porcelain) ]]; then
52-
echo "Changes detected in the refcache etc:"
53-
git status --short
54-
55-
echo "\nPushing changes to PR."
56-
git config --local user.email "$USER_EMAIL"
57-
git config --local user.name "$USER_NAME"
58-
git add -A
59-
git commit -m "Updates from build-and-check-links workflow"
60-
git push
61-
62-
echo "Failing workflow so that changes can be reviewed, and checks rerun."
63-
exit 1
64-
fi
65-
env:
66-
GH_TOKEN: ${{ secrets.OPENTELEMETRYBOT_GITHUB_TOKEN }}
67-
USER_EMAIL: 107717825+opentelemetrybot@users.noreply.github.com
68-
USER_NAME: opentelemetrybot
69-
7058
- uses: actions/upload-artifact@v4
7159
with:
7260
name: build-log-etc
@@ -75,6 +63,36 @@ jobs:
7563
tmp/package*.json
7664
static/refcache.json
7765
66+
- name: Push changes if any, and fail check
67+
if: ${{ env.CHANGED_FILES }}
68+
run: |
69+
echo "Changes detected in the refcache etc:"
70+
git status --short
71+
72+
echo 'cmd: gh pr checkout $PR_NUM -b "pr-check-links-${RANDOM}"'
73+
# git branch -v
74+
75+
# git config --local user.email "$USER_EMAIL"
76+
# git config --local user.name "$USER_NAME"
77+
# git add -A
78+
# git commit -m "Updates from build-and-check-links workflow"
79+
80+
# echo "\nPushing changes to PR."
81+
# current_branch=$(git rev-parse --abbrev-ref HEAD)
82+
# echo current_branch=$current_branch
83+
# # gh pr checkout sets some git configs that we can use to make sure
84+
# # we push to the right repo & to the right branch
85+
# remote_repo=$(git config --get branch.${current_branch}.remote)
86+
# echo remote_repo=$remote_repo
87+
# remote_branch=$(git config --get branch.${current_branch}.merge)
88+
# echo remote_branch=$remote_branch
89+
# git push ${remote_repo} HEAD:${remote_branch}
90+
91+
# echo "Failing workflow so that changes can be reviewed, and checks rerun."
92+
# exit 1
93+
# env:
94+
# GH_TOKEN: ${{ secrets.OPENTELEMETRYBOT_GITHUB_TOKEN }}
95+
7896
check-refcache:
7997
name: REFCACHE updates?
8098
needs: build-and-check-links
@@ -86,7 +104,9 @@ jobs:
86104
- name: Fail when refcache contains entries with HTTP status 4XX
87105
run: |
88106
if grep -B 1 -e '"StatusCode": 4' static/refcache.json; then
89-
echo "Run 'npx gulp prune' to remove 4xx entries from the refcache"
107+
echo "Run 'npm run _refcache:prune' to remove 404 entries from refcache.json,"
108+
echo "or run './scripts/double-check-refcache-400s.mjs' locally to address"
109+
echo "other 400-status entries."
90110
exit 1
91111
fi
92112
- name: Does the refcache need updating?

0 commit comments

Comments
 (0)
Please sign in to comment.