From 36b7f27b1603ac3716ba31d99bfc42082ee6c042 Mon Sep 17 00:00:00 2001
From: Randy Fay <34826-rfay@users.noreply.drupalcode.org>
Date: Tue, 17 Sep 2024 15:28:59 +0000
Subject: [PATCH] Provide github workflow to automatically sync and update
readme to point to drupal.org
---
.github/workflows/mirror.yml | 64 +++++++++++++++++++++++++++++
README.md | 79 +++---------------------------------
2 files changed, 69 insertions(+), 74 deletions(-)
create mode 100644 .github/workflows/mirror.yml
diff --git a/.github/workflows/mirror.yml b/.github/workflows/mirror.yml
new file mode 100644
index 0000000..4aa5a8e
--- /dev/null
+++ b/.github/workflows/mirror.yml
@@ -0,0 +1,64 @@
+# 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
+
+
diff --git a/README.md b/README.md
index c67a457..fcd4576 100644
--- a/README.md
+++ b/README.md
@@ -1,78 +1,9 @@
# DrupalPod
-|
:point_right: Start here
1. Download the DrupalPod browser extension
[Chrome](https://chrome.google.com/webstore/detail/drupalpod-helper-extensio/pjfjhkcfkhbemnbpkakjhmboacefmjjl?hl=en) or [Firefox](https://addons.mozilla.org/en-US/firefox/addon/drupalpod).
2. Go to any issue page on Drupal.org
(core, module, or theme).
3. Click on the DrupalPod extension.
4. (Optional) Choose a patch / issue fork / branch.
:tada: A full Drupal development environment is being generated for you :tada:
Please submit [feedback, bug reports and feature requests](https://github.com/shaal/DrupalPod/issues/new/choose) | [![DrupalPod logo](https://user-images.githubusercontent.com/22901/122864786-40253c00-d2f3-11eb-959b-61fb6871e3f4.png)](https://gitpod.io/from-referrer/) |
-| - | :- |
+## **IF YOU ARE ON GITHUB THIS IS NOT THE REPOSITORY YOU WANT**
+## **THE DRUPALPOD REPOSITORY HAS MOVED TO https://drupal.org/project/DrupalPod**
-
+* Please file issues there.
+* Please do Merge Requests there.
+* This repo is just a mirror.
-## About the project
-
-This project allows you to work on Drupal contributions with a familiar setup of a "normal" Drupal website.\
-No computer is needed because it is all running in the cloud.
-
-* Install additional packages - `ddev composer`
-* Run Drush commands - `ddev drush `
-* Run tests
- * Nightwatch - `ddev nightwatch `
- * PHPUnit - `ddev phpunit `
-* IDE in a browser
- * VScode (default)
- * PHPStorm - run `phpstorm`
-
-
-
-## Project structure
-
-* Every project is cloned into `/repos/`
-* Required by composer
-* Symlinked into a normal Drupal website structure:
- * Core directory `/web/core`
- * Module directory `/web/modules/contrib/module_name`
- * Theme directory `/web/themes/contrib/theme_name`
-
-
-
-## The secret sauce
-
-* [Gitpod](https://www.gitpod.io) - development environment in the cloud
-* [DDEV](https://ddev.readthedocs.io/en/stable) - easy setup for PHP projects using Docker
-* [DrupalPod](https://chrome.google.com/webstore/detail/drupalpod-helper-extensio/pjfjhkcfkhbemnbpkakjhmboacefmjjl?hl=en
-) Browser Extension
-* [Drupal Core Development Project](https://github.com/joachim-n/drupal-core-development-project)
-
-
-
-## Pushing code
-
-_\* In order to push code, a **one time** SSH keys setup is required._
-
-From within a Gitpod workspace run:
-
-1. `.gitpod/drupal/ssh/02-setup-private-ssh.sh` \
-Follow the instructions on the screen.
-
-1. `.gitpod/drupal/ssh/04-confirm-ssh-setup.sh` \
-If SSH keys are valid, it stores your private SSH key as an environment variable in Gitpod.
-
-
-
-## Notes
-
-* Manual SSH setup is a temporary requirement until the Drupal's self-hosted Gitlab gets integrated with Gitpod.
-
- [WIP - making a friendlier interactive dialog](https://github.com/shaal/DrupalPod/issues/4).
-
-* If you prefer working locally - you can clone this repo to your computer.\
- The only 2 requirements are [Docker](https://ddev.readthedocs.io/en/stable/users/docker_installation/) and [DDEV](https://ddev.readthedocs.io/en/stable/#installation).
-
-
-
-## Thank you
-
-* [Randy Fay](https://github.com/rfay)
-* [Joe Still](https://github.com/bioshazard)
-* [Joachim](https://github.com/joachim-n)
-
----
-
-![DrupalPod-logo](https://user-images.githubusercontent.com/22901/122864786-40253c00-d2f3-11eb-959b-61fb6871e3f4.png)