Skip to repository content

tenant.openagents/omega

No repository description is available.

OpenAgents Git authority 2026-07-28T01:30:55.488Z Public web read
NIP-34 coordinate30617:7649603503856e5148d571eac2766b288a8ff1e9e35d380337a1d2b0015b4f92:omega
MaintainersHidden in public view
References2 branches · 1 tag
Read-only clonegit clone https://openagents.com/git/tenant.openagents/omega.git
Browse files

extension_workflow_rollout.yml

245 lines · 9.6 KB · yaml
1# Generated from xtask::workflows::extension_workflow_rollout
2# Rebuild with `cargo xtask workflows`.
3name: extension_workflow_rollout
4env:
5  CARGO_TERM_COLOR: always
6on:
7  workflow_dispatch:
8    inputs:
9      filter-repos:
10        description: Comma-separated list of repository names to rollout to. Leave empty for all repos.
11        type: string
12        default: ''
13      change-description:
14        description: Description for the changes to be expected with this rollout
15        type: string
16        default: ''
17permissions:
18  contents: read
19jobs:
20  fetch_extension_repos:
21    if: (github.repository_owner == 'zed-industries' || github.repository_owner == 'zed-extensions') && (github.ref == 'refs/tags/extension-workflows' || github.ref == 'refs/heads/main')
22    runs-on: namespace-profile-2x4-ubuntu-2404
23    steps:
24    - name: checkout_zed_repo
25      uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd
26      with:
27        clean: false
28        fetch-depth: 0
29    - id: prev-tag
30      name: extension_workflow_rollout::fetch_extension_repos::get_previous_tag_commit
31      run: |
32        PREV_COMMIT=$(git rev-parse "extension-workflows^{commit}" 2>/dev/null || echo "")
33        if [ -z "$PREV_COMMIT" ]; then
34            echo "::error::No previous rollout tag 'extension-workflows' found. Cannot determine file changes."
35            exit 1
36        fi
37        echo "Found previous rollout at commit: $PREV_COMMIT"
38        echo "prev_commit=$PREV_COMMIT" >> "$GITHUB_OUTPUT"
39    - id: calc-changes
40      name: extension_workflow_rollout::fetch_extension_repos::get_removed_files
41      run: |
42        for workflow_type in "ci" "shared"; do
43            if [ "$workflow_type" = "ci" ]; then
44                WORKFLOW_DIR="extensions/workflows"
45            else
46                WORKFLOW_DIR="extensions/workflows/shared"
47            fi
48
49            REMOVED=$(git diff --name-status -M "$PREV_COMMIT" HEAD -- "$WORKFLOW_DIR" | \
50                awk '/^D/ { print $2 } /^R/ { print $2 }' | \
51                xargs -I{} basename {} 2>/dev/null | \
52                tr '\n' ' ' || echo "")
53            REMOVED=$(echo "$REMOVED" | xargs)
54
55            echo "Removed files for $workflow_type: $REMOVED"
56            echo "removed_${workflow_type}=$REMOVED" >> "$GITHUB_OUTPUT"
57        done
58      env:
59        PREV_COMMIT: ${{ steps.prev-tag.outputs.prev_commit }}
60    - id: list-repos
61      name: get_repositories
62      uses: actions/github-script@f28e40c7f34bde8b3046d885e986cb6290c5673b
63      with:
64        script: |
65          const repos = await github.paginate(github.rest.repos.listForOrg, {
66              org: 'zed-extensions',
67              type: 'public',
68              per_page: 100,
69          });
70
71          let filteredRepos = repos
72              .filter(repo => !repo.archived)
73              .map(repo => repo.name);
74
75          const filterInput = process.env.FILTER_REPOS.trim();
76          if (filterInput.length > 0) {
77              const allowedNames = filterInput.split(',').map(s => s.trim()).filter(s => s.length > 0);
78              filteredRepos = filteredRepos.filter(name => allowedNames.includes(name));
79              console.log(`Filter applied. Matched ${filteredRepos.length} repos from ${allowedNames.length} requested.`);
80          }
81
82          console.log(`Found ${filteredRepos.length} extension repos`);
83          return filteredRepos;
84        result-encoding: json
85      env:
86        FILTER_REPOS: ${{ inputs.filter-repos }}
87    - name: steps::cache_rust_dependencies_namespace
88      uses: namespacelabs/nscloud-cache-action@a90bb5d4b27522ce881c6e98eebd7d7e6d1653f9
89      with:
90        cache: rust
91        path: ~/.rustup
92    - name: extension_workflow_rollout::fetch_extension_repos::generate_workflow_files
93      run: |
94        cargo xtask workflows "$COMMIT_SHA"
95      env:
96        COMMIT_SHA: ${{ github.sha }}
97    - name: extension_workflow_rollout::fetch_extension_repos::upload_workflow_files
98      uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a
99      with:
100        name: extension-workflow-files
101        path: extensions/workflows/**/*.yml
102        if-no-files-found: error
103    outputs:
104      repos: ${{ steps.list-repos.outputs.result }}
105      prev_commit: ${{ steps.prev-tag.outputs.prev_commit }}
106      removed_ci: ${{ steps.calc-changes.outputs.removed_ci }}
107      removed_shared: ${{ steps.calc-changes.outputs.removed_shared }}
108    timeout-minutes: 10
109  rollout_workflows_to_extension:
110    needs:
111    - fetch_extension_repos
112    if: needs.fetch_extension_repos.outputs.repos != '[]'
113    runs-on: namespace-profile-2x4-ubuntu-2404
114    strategy:
115      matrix:
116        repo: ${{ fromJson(needs.fetch_extension_repos.outputs.repos) }}
117      fail-fast: false
118      max-parallel: 10
119    steps:
120    - id: generate-token
121      name: steps::generate_token
122      uses: actions/create-github-app-token@f8d387b68d61c58ab83c6c016672934102569859
123      with:
124        app-id: ${{ secrets.ZED_ZIPPY_APP_ID }}
125        private-key: ${{ secrets.ZED_ZIPPY_APP_PRIVATE_KEY }}
126        owner: zed-extensions
127        repositories: ${{ matrix.repo }}
128        permission-pull-requests: write
129        permission-contents: write
130        permission-workflows: write
131    - name: checkout_extension_repo
132      uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd
133      with:
134        clean: false
135        path: extension
136        repository: zed-extensions/${{ matrix.repo }}
137        token: ${{ steps.generate-token.outputs.token }}
138    - name: extension_workflow_rollout::rollout_workflows_to_extension::download_workflow_files
139      uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c
140      with:
141        name: extension-workflow-files
142        path: workflow-files
143    - name: extension_workflow_rollout::rollout_workflows_to_extension::sync_workflow_files
144      run: |
145        mkdir -p extension/.github/workflows
146
147        if [ "$MATRIX_REPO" = "workflows" ]; then
148            REMOVED_FILES="$REMOVED_CI"
149        else
150            REMOVED_FILES="$REMOVED_SHARED"
151        fi
152
153        cd extension/.github/workflows
154
155        if [ -n "$REMOVED_FILES" ]; then
156            for file in $REMOVED_FILES; do
157                if [ -f "$file" ]; then
158                    rm -f "$file"
159                fi
160            done
161        fi
162
163        cd - > /dev/null
164
165        if [ "$MATRIX_REPO" = "workflows" ]; then
166            cp workflow-files/*.yml extension/.github/workflows/
167        else
168            cp workflow-files/shared/*.yml extension/.github/workflows/
169        fi
170      env:
171        REMOVED_CI: ${{ needs.fetch_extension_repos.outputs.removed_ci }}
172        REMOVED_SHARED: ${{ needs.fetch_extension_repos.outputs.removed_shared }}
173        MATRIX_REPO: ${{ matrix.repo }}
174    - id: short-sha
175      name: extension_workflow_rollout::rollout_workflows_to_extension::get_short_sha
176      run: |
177        echo "sha_short=$(echo "$GITHUB_SHA" | cut -c1-7)" >> "$GITHUB_OUTPUT"
178    - id: create-pr
179      name: steps::create_pull_request
180      uses: peter-evans/create-pull-request@98357b18bf14b5342f975ff684046ec3b2a07725
181      with:
182        title: Update CI workflows to `${{ steps.short-sha.outputs.sha_short }}`
183        body: |
184          This PR updates the CI workflow files from the main Zed repository
185          based on the commit zed-industries/zed@${{ github.sha }}
186
187          ${{ inputs.change-description }}
188        commit-message: Update CI workflows to `${{ steps.short-sha.outputs.sha_short }}`
189        branch: update-workflows
190        committer: zed-zippy[bot] <234243425+zed-zippy[bot]@users.noreply.github.com>
191        author: zed-zippy[bot] <234243425+zed-zippy[bot]@users.noreply.github.com>
192        base: main
193        delete-branch: true
194        token: ${{ steps.generate-token.outputs.token }}
195        sign-commits: true
196        assignees: ${{ inputs.filter-repos != '' && github.actor || '' }}
197        path: extension
198    - name: extension_workflow_rollout::rollout_workflows_to_extension::enable_auto_merge
199      run: |
200        if [ -n "$PR_NUMBER" ]; then
201            gh pr merge "$PR_NUMBER" --auto --squash
202        fi
203      env:
204        GH_TOKEN: ${{ steps.generate-token.outputs.token }}
205        PR_NUMBER: ${{ steps.create-pr.outputs.pull-request-number }}
206      working-directory: extension
207    timeout-minutes: 10
208  create_rollout_tag:
209    needs:
210    - rollout_workflows_to_extension
211    if: inputs.filter-repos == ''
212    runs-on: namespace-profile-2x4-ubuntu-2404
213    steps:
214    - id: generate-token
215      name: steps::generate_token
216      uses: actions/create-github-app-token@f8d387b68d61c58ab83c6c016672934102569859
217      with:
218        app-id: ${{ secrets.ZED_ZIPPY_APP_ID }}
219        private-key: ${{ secrets.ZED_ZIPPY_APP_PRIVATE_KEY }}
220        owner: ${{ github.repository_owner }}
221        repositories: ${{ github.event.repository.name }}
222        permission-contents: write
223    - name: steps::checkout_repo
224      uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd
225      with:
226        clean: false
227        fetch-depth: 0
228        token: ${{ steps.generate-token.outputs.token }}
229    - name: steps::update_tag
230      uses: actions/github-script@f28e40c7f34bde8b3046d885e986cb6290c5673b
231      with:
232        script: |
233          github.rest.git.updateRef({
234              owner: context.repo.owner,
235              repo: context.repo.repo,
236              ref: 'tags/extension-workflows',
237              sha: context.sha,
238              force: true
239          })
240        github-token: ${{ steps.generate-token.outputs.token }}
241    timeout-minutes: 1
242defaults:
243  run:
244    shell: bash -euxo pipefail {0}
245
Served at tenant.openagents/omega Member data and write actions are omitted.