Repository: rust-lang/rust-analyzer
Pull request #19078 (2025-02-01 06:21:41)

minor: Stop running some release workflows on forks and update old URLs


Patch:
diff --git a/.github/workflows/autopublish.yaml b/.github/workflows/autopublish.yaml
index 5258d9ddd3..e4fa94643b 100644
--- a/.github/workflows/autopublish.yaml
+++ b/.github/workflows/autopublish.yaml
@@ -11,6 +11,7 @@ on:
 
 jobs:
   publish:
+    if: ${{ github.repository == 'rust-lang/rust-analyzer' || github.event.action == 'workflow_dispatch' }}
     name: publish
     runs-on: ubuntu-latest
     steps:
diff --git a/.github/workflows/publish-libs.yaml b/.github/workflows/publish-libs.yaml
index f1533bf26e..5023a634fd 100644
--- a/.github/workflows/publish-libs.yaml
+++ b/.github/workflows/publish-libs.yaml
@@ -9,6 +9,7 @@ on:
 
 jobs:
   publish-libs:
+    if: ${{ github.repository == 'rust-lang/rust-analyzer' || github.event.action == 'workflow_dispatch' }}
     name: publish
     runs-on: ubuntu-latest
     steps:
diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml
index 39ac652de0..3f1c8b2a9c 100644
--- a/.github/workflows/release.yaml
+++ b/.github/workflows/release.yaml
@@ -22,6 +22,7 @@ env:
 
 jobs:
   dist:
+    if: ${{ github.repository == 'rust-lang/rust-analyzer' || github.event.action == 'workflow_dispatch' }}
     strategy:
       matrix:
         include:
@@ -138,6 +139,7 @@ jobs:
           path: ./dist
 
   dist-x86_64-unknown-linux-musl:
+    if: ${{ github.repository == 'rust-lang/rust-analyzer' || github.event.action == 'workflow_dispatch' }}
     name: dist (x86_64-unknown-linux-musl)
     runs-on: ubuntu-latest
     env:
@@ -183,6 +185,7 @@ jobs:
           path: ./dist
 
   publish:
+    if: ${{ github.repository == 'rust-lang/rust-analyzer' || github.event.action == 'workflow_dispatch' }}
     name: publish
     runs-on: ubuntu-latest
     needs: ["dist", "dist-x86_64-unknown-linux-musl"]
@@ -257,24 +260,24 @@ jobs:
         working-directory: ./editors/code
 
       - name: Publish Extension (Code Marketplace, release)
-        if: github.ref == 'refs/heads/release' && (github.repository == 'rust-analyzer/rust-analyzer' || github.repository == 'rust-lang/rust-analyzer')
+        if: github.ref == 'refs/heads/release' && github.repository == 'rust-lang/rust-analyzer'
         working-directory: ./editors/code
         # token from https://dev.azure.com/rust-analyzer/
         run: npx vsce publish --pat ${{ secrets.MARKETPLACE_TOKEN }} --packagePath ../../dist/rust-analyzer-*.vsix
 
       - name: Publish Extension (OpenVSX, release)
-        if: github.ref == 'refs/heads/release' && (github.repository == 'rust-analyzer/rust-analyzer' || github.repository == 'rust-lang/rust-analyzer')
+        if: github.ref == 'refs/heads/release' && github.repository == 'rust-lang/rust-analyzer'
         working-directory: ./editors/code
         run: npx ovsx publish --pat ${{ secrets.OPENVSX_TOKEN }} --packagePath ../../dist/rust-analyzer-*.vsix
         timeout-minutes: 2
 
       - name: Publish Extension (Code Marketplace, nightly)
-        if: github.ref != 'refs/heads/release' && (github.repository == 'rust-analyzer/rust-analyzer' || github.repository == 'rust-lang/rust-analyzer')
+        if: github.ref != 'refs/heads/release' && github.repository == 'rust-lang/rust-analyzer'
         working-directory: ./editors/code
         run: npx vsce publish --pat ${{ secrets.MARKETPLACE_TOKEN }} --packagePath ../../dist/rust-analyzer-*.vsix --pre-release
 
       - name: Publish Extension (OpenVSX, nightly)
-        if: github.ref != 'refs/heads/release' && (github.repository == 'rust-analyzer/rust-analyzer' || github.repository == 'rust-lang/rust-analyzer')
+        if: github.ref != 'refs/heads/release' && github.repository == 'rust-lang/rust-analyzer'
         working-directory: ./editors/code
         run: npx ovsx publish --pat ${{ secrets.OPENVSX_TOKEN }} --packagePath ../../dist/rust-analyzer-*.vsix
         timeout-minutes: 2
diff --git a/README.md b/README.md
index 552f71f151..fb885c5be7 100644
--- a/README.md
+++ b/README.md
@@ -1,6 +1,6 @@
 <p align="center">
   <img
-    src="https://raw.githubusercontent.com/rust-analyzer/rust-analyzer/master/assets/logo-wide.svg"
+    src="https://raw.githubusercontent.com/rust-lang/rust-analyzer/master/assets/logo-wide.svg"
     alt="rust-analyzer logo">
 </p>
 
diff --git a/xtask/src/publish/notes.rs b/xtask/src/publish/notes.rs
index c30267295b..7245ce2431 100644
--- a/xtask/src/publish/notes.rs
+++ b/xtask/src/publish/notes.rs
@@ -549,18 +549,18 @@ impl Macro {
             }
             "pr" => {
                 let pr = &self.target;
-                let url = format!("https://github.com/rust-analyzer/rust-analyzer/pull/{pr}");
+                let url = format!("https://github.com/rust-lang/rust-analyzer/pull/{pr}");
                 format!("[`#{pr}`]({url})")
             }
             "commit" => {
                 let hash = &self.target;
                 let short = &hash[0..7];
-                let url = format!("https://github.com/rust-analyzer/rust-analyzer/commit/{hash}");
+                let url = format!("https://github.com/rust-lang/rust-analyzer/commit/{hash}");
                 format!("[`{short}`]({url})")
             }
             "release" => {
                 let date = &self.target;
-                let url = format!("https://github.com/rust-analyzer/rust-analyzer/releases/{date}");
+                let url = format!("https://github.com/rust-lang/rust-analyzer/releases/{date}");
                 format!("[`{date}`]({url})")
             }
             _ => bail!("macro not supported: {name}"),


Test patch:
diff --git a/xtask/test_data/expected.md b/xtask/test_data/expected.md
index 19c940c67b..301837b5c2 100644
--- a/xtask/test_data/expected.md
+++ b/xtask/test_data/expected.md
@@ -2,12 +2,12 @@
 
 Hello!
 
-Commit: [`0123456`](https://github.com/rust-analyzer/rust-analyzer/commit/0123456789abcdef0123456789abcdef01234567) \
-Release: [`2022-01-01`](https://github.com/rust-analyzer/rust-analyzer/releases/2022-01-01)
+Commit: [`0123456`](https://github.com/rust-lang/rust-analyzer/commit/0123456789abcdef0123456789abcdef01234567) \
+Release: [`2022-01-01`](https://github.com/rust-lang/rust-analyzer/releases/2022-01-01)
 
 ## New Features
 
-- **BREAKING** [`#1111`](https://github.com/rust-analyzer/rust-analyzer/pull/1111) shortcut <kbd>ctrl</kbd>+<kbd>r</kbd>
+- **BREAKING** [`#1111`](https://github.com/rust-lang/rust-analyzer/pull/1111) shortcut <kbd>ctrl</kbd>+<kbd>r</kbd>
   - hyphen-prefixed list item
 - nested list item
   - `foo` -> `foofoo`
@@ -65,7 +65,7 @@ Release: [`2022-01-01`](https://github.com/rust-analyzer/rust-analyzer/releases/
 - list item with an inline image
   ![](https://example.com/animation.gif)
 
-The highlight of the month is probably [`#1111`](https://github.com/rust-analyzer/rust-analyzer/pull/1111).
+The highlight of the month is probably [`#1111`](https://github.com/rust-lang/rust-analyzer/pull/1111).
 See [online manual](https://example.com/manual) for more information.
 
 ```bash