Skip to content

Commit

Permalink
skip privilaged ci steps on project forks
Browse files Browse the repository at this point in the history
  • Loading branch information
ben-manes committed Dec 29, 2023
1 parent fd89232 commit c79bcfc
Show file tree
Hide file tree
Showing 16 changed files with 24 additions and 14 deletions.
2 changes: 2 additions & 0 deletions .github/workflows/benchmarks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ jobs:
uses: exuanbo/actions-deploy-gist@47697fceaeea2006a90594ee24eb9cd0a1121ef8 # v1.1.4
if: >
github.event_name == 'push'
&& github.event.repository.fork == false
&& endsWith(github.ref, github.event.repository.default_branch)
with:
token: ${{ secrets.GIST_TOKEN }}
Expand All @@ -74,6 +75,7 @@ jobs:
uses: exuanbo/actions-deploy-gist@47697fceaeea2006a90594ee24eb9cd0a1121ef8 # v1.1.4
if: >
github.event_name == 'push'
&& github.event.repository.fork == false
&& endsWith(github.ref, github.event.repository.default_branch)
with:
token: ${{ secrets.GIST_TOKEN }}
Expand Down
9 changes: 5 additions & 4 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@ env:
GRADLE_ENTERPRISE_CACHE_PASSWORD: ${{ secrets.GRADLE_ENTERPRISE_CACHE_PASSWORD }}
GRADLE_ENTERPRISE_ACCESS_KEY: ${{ secrets.GRADLE_ENTERPRISE_ACCESS_KEY }}
ALLOWED_ENDPOINTS: >
*.actions.githubusercontent.com:443
api.adoptium.net:443
api.github.com:443
api.snapcraft.io:443
artifactcache.actions.githubusercontent.com:443
caffeine.gradle-enterprise.cloud:443
cdn.azul.com:443
cloudflare.com:443
Expand All @@ -28,7 +28,6 @@ env:
jcenter.bintray.com:443
objects.githubusercontent.com:443
oss.sonatype.org:443
pipelines.actions.githubusercontent.com:443
plugins.gradle.org:443
plugins-artifacts.gradle.org:443
raw.githubusercontent.com:443
Expand Down Expand Up @@ -210,7 +209,7 @@ jobs:
name: Coverage
runs-on: ubuntu-latest
needs: tests
if: github.event_name == 'push'
if: (github.event_name == 'push') && (github.event.repository.fork == false)
steps:
- name: Harden Runner
uses: step-security/harden-runner@eb238b55efaa70779f274895e782ed17c84f2895 # v2.6.1
Expand Down Expand Up @@ -311,7 +310,8 @@ jobs:
- name: Upload badge to Gist
uses: popsiclestick/gist-sync-action@88f8633178625914f2a01abf1a765f7272a580fa # v1.2.0
if: >
steps.test-badge.outcome == 'success'
github.event.repository.fork == false
&& steps.test-badge.outcome == 'success'
&& endsWith(github.ref, github.event.repository.default_branch)
with:
gist_url: https://gist.githubusercontent.com/ben-manes/c20eb418f0e0bd6dfe1c25beb35faae4
Expand All @@ -326,6 +326,7 @@ jobs:
needs: tests
if: >
github.event_name == 'push'
&& github.event.repository.fork == false
&& endsWith(github.ref, github.event.repository.default_branch)
steps:
- name: Harden Runner
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/codacy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ jobs:
actions: read
contents: read
security-events: write
if: github.event.repository.fork == false
steps:
- name: Harden Runner
uses: step-security/harden-runner@eb238b55efaa70779f274895e782ed17c84f2895 # v2.6.1
Expand Down
5 changes: 4 additions & 1 deletion .github/workflows/examples.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ env:
GRADLE_ENTERPRISE_CACHE_PASSWORD: ${{ secrets.GRADLE_ENTERPRISE_CACHE_PASSWORD }}
GRADLE_ENTERPRISE_ACCESS_KEY: ${{ secrets.GRADLE_ENTERPRISE_ACCESS_KEY }}
JAVA_VERSION: 21
SNAPSHOT: true

jobs:
examples:
Expand Down Expand Up @@ -110,12 +109,16 @@ jobs:
run: ./gradlew build
- name: Prepare for Graal Native Image
uses: ./.github/actions/run-gradle
env:
SNAPSHOT: true
with:
java: GraalVM
token: ${{ secrets.GITHUB_TOKEN }}
arguments: -q caffeine:clean caffeine:jar
- name: Graal Native Image
uses: ./.github/actions/run-gradle
env:
SNAPSHOT: true
with:
java: GraalVM
token: ${{ secrets.GITHUB_TOKEN }}
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ env:
jobs:
release:
runs-on: ubuntu-latest
if: github.event.repository.fork == false
steps:
- name: Harden Runner
uses: step-security/harden-runner@eb238b55efaa70779f274895e782ed17c84f2895 # v2.6.1
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/scorecards-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ jobs:
id-token: write
actions: read
contents: read
if: github.event.repository.fork == false
steps:
- name: Harden Runner
uses: step-security/harden-runner@eb238b55efaa70779f274895e782ed17c84f2895 # v2.6.1
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/snyk.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ jobs:
actions: read
contents: read
security-events: write
if: github.event.repository.fork == false
steps:
- name: Harden Runner
uses: step-security/harden-runner@eb238b55efaa70779f274895e782ed17c84f2895 # v2.6.1
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/spelling.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jobs:
raw.githubusercontent.com:443
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
- name: Install
run: wget -O - -q https://raw.githubusercontent.com/client9/misspell/master/install-misspell.sh | sh -s -- -b .
run: curl -sfL https://raw.githubusercontent.com/golangci/misspell/master/install-misspell.sh | sh -s -- -b .
- name: Spell Check with Misspell
run: ./misspell -error .
- name: Spell Check with Typos
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ class Key implements Comparable<Key> {
final int i;
Key(int i) { this.i = i; }
@Override
public int hashCode() { return poorHash ? 0 : super.hashCode(); }
public int hashCode() { return poorHash ? 0 : System.identityHashCode(this); }
@Override
public int compareTo(Key x) {
return Integer.compare(this.i, x.i);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
distributionUrl=https\://services.gradle.org/distributions/gradle-8.5-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.6-rc-1-bin.zip
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
distributionUrl=https\://services.gradle.org/distributions/gradle-8.5-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.6-rc-1-bin.zip
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
distributionUrl=https\://services.gradle.org/distributions/gradle-8.5-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.6-rc-1-bin.zip
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
distributionUrl=https\://services.gradle.org/distributions/gradle-8.5-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.6-rc-1-bin.zip
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
distributionUrl=https\://services.gradle.org/distributions/gradle-8.5-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.6-rc-1-bin.zip
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
Expand Down
2 changes: 1 addition & 1 deletion gradle/libs.versions.toml
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,7 @@ zstd = { module = "com.github.luben:zstd-jni", version.ref = "zstd" }
[bundles]
coherence = ["coherence-core", "json-bind"]
constraints = ["bcel", "bouncycastle", "commons-text", "httpclient",
"jcommander", "jgit", "jsoup", "okhttp", "protobuf", "snakeyaml" ]
"guava", "jcommander", "jgit", "jsoup", "okhttp", "protobuf", "snakeyaml" ]
errorprone-support = [ "errorprone-support", "errorprone-support-refaster" ]
jmh = ["jmh-core", "jmh-plugin", "jmh-report"]
junit = ["junit4", "junit5"]
Expand Down
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
distributionUrl=https\://services.gradle.org/distributions/gradle-8.5-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.6-rc-1-bin.zip
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
Expand Down

0 comments on commit c79bcfc

Please sign in to comment.