Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
D
drupalpod
Manage
Activity
Members
Labels
Plan
Wiki
Custom issue tracker
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Model registry
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
project
drupalpod
Merge requests
!8
Provide github workflow to automatically sync and update readme to point to drupal.org
Code
Review changes
Check out branch
Download
Patches
Plain diff
Merged
Provide github workflow to automatically sync and update readme to point to drupal.org
issue/drupalpod-3474581:main
into
main
Overview
0
Commits
19
Pipelines
0
Changes
2
Merged
Randy Fay
requested to merge
issue/drupalpod-3474581:main
into
main
6 months ago
Overview
0
Commits
19
Pipelines
0
Changes
2
Expand
Adds a github workflow to sync daily from drupal -> github
Updates the README (only seen on GitHub) to point to the drupal.org repository
1
0
Merge request reports
Compare
main
main (base)
and
latest version
latest version
a0d0cf6f
19 commits,
6 months ago
2 files
+
69
−
74
Inline
Compare changes
Side-by-side
Inline
Show whitespace changes
Show one file at a time
Files
2
Search (e.g. *.vue) (Ctrl+P)
.github/workflows/mirror.yml
0 → 100644
+
64
−
0
Options
# This mirrors daily from an upstream repository.
# These two things must be set:
# UPSTREAM_REPO should be set to something like
# https://git.drupalcode.org/issue/drupalpod-3474581.git
# WORKFLOW_TOKEN is a secret in the "normal" environment containing
# a fine-grained PAT with permissions to read/write content and read/write workflows
name
:
Mirror from Upstream
defaults
:
run
:
shell
:
bash
on
:
schedule
:
-
cron
:
'
0
0
*
*
*'
# Runs daily at midnight UTC
workflow_dispatch
:
# Allows manual triggering of the workflow
permissions
:
contents
:
write
jobs
:
mirror
:
runs-on
:
ubuntu-latest
env
:
CLONEDIR
:
"
/tmp/clonedir"
# The environment variables will be in the environment "normal"
environment
:
"
normal"
steps
:
-
name
:
Set up Git environment
run
:
|
git config --global user.name "GitHub Action"
git config --global user.email "action@github.com"
-
name
:
Clone upstream repository
run
:
|
set -x
set -eu -o pipefail
mkdir -p ${CLONEDIR}
# The variable UPSTREAM_REPO must be set in the repository's
# "normal" environment
git clone --mirror "${{ vars.UPSTREAM_REPO }}" "${{ env.CLONEDIR }}"
-
name
:
Remove existing Git credentials
run
:
|
git config --global --unset-all http.https://github.com/.extraheader || true
-
name
:
Push to GitHub
env
:
# The WORKFLOW_TOKEN is a fine-grained PAT with
# contents: read-write and
# workflow:read/write perm for this repo
WORKFLOW_TOKEN
:
${{ secrets.WORKFLOW_TOKEN }}
REPO
:
${{ github.repository }}
run
:
|
set -x
cd ${{ env.CLONEDIR }}
git remote set-url origin "https://github.com/${REPO}.git"
git config --global user.name "GitHub Action"
git config --global user.email "action@github.com"
git remote set-url origin "https://x-access-token:${WORKFLOW_TOKEN}@github.com/${REPO}.git"
git push --mirror
Loading