Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

XXX: Break formatting #921

Closed
wants to merge 4 commits into from
Closed

XXX: Break formatting #921

wants to merge 4 commits into from

Conversation

tstellar
Copy link
Owner

No description provided.

Actions triggered by pull_request_target events have access to all
repository secrets, so it is unsafe to use them when executing
untrusted code.  The pr-code-format workflow does not execute
any untrusted code, but it passes untrused input into clang-format.
An attacker could use this to exploit a flaw in clang-format and
potentially gain access to the repository secrets.

By splitting the workflow, we can use the pull_request target which
is more secure and isolate the issue write permissions in a separate
job.  The pull_request target also makes it easier to test changes
to the code-format-helepr.py script, because the version of the
script from the pull request will be used rather than the
version of the script from main.

Fixes llvm#77142
Copy link

✅ With the latest revision this PR passed the Python code formatter.

Copy link

⚠️ C/C++ code formatter, clang-format found issues in your code. ⚠️

You can test this locally with the following command:
git-clang-format --diff 9a0012c21ff02ec826f25e13583843eb404f13b4 89a5ac6c65f9a0014d2bff2a07f846bfc4566be0 -- llvm/lib/Target/AMDGPU/AMDGPUTargetMachine.cpp
View the diff from clang-format here.
diff --git a/llvm/lib/Target/AMDGPU/AMDGPUTargetMachine.cpp b/llvm/lib/Target/AMDGPU/AMDGPUTargetMachine.cpp
index fb92254a90..0f3bb3e7b0 100644
--- a/llvm/lib/Target/AMDGPU/AMDGPUTargetMachine.cpp
+++ b/llvm/lib/Target/AMDGPU/AMDGPUTargetMachine.cpp
@@ -17,7 +17,7 @@
 #include "AMDGPUAliasAnalysis.h"
 #include "AMDGPUCtorDtorLowering.h"
 #include "AMDGPUExportClustering.h"
-     #include "AMDGPUIGroupLP.h"
+#include "AMDGPUIGroupLP.h"
 #include "AMDGPUMacroFusion.h"
 #include "AMDGPURegBankSelect.h"
 #include "AMDGPUTargetObjectFile.h"

@tstellar tstellar force-pushed the main branch 6 times, most recently from b0633a3 to 1b98494 Compare January 20, 2024 17:03
@tstellar tstellar closed this Jan 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant